ZT_CMP_RUNE(3)

πŸ’… ZT_CMP_RUNE(3) β€” bestie, it's a rune comparison claim ✨

okay so this is ZT_CMP_RUNE(3) from the LOCAL manual, and it's literally the cutest lil thing: it builds a claim that two characters (runes) are in some relation to each other. πŸ¦‹


✨ NAME ✨

ZT_CMP_RUNE, zt_cmp_rune β€” construct a claim of a relation between two characters (runes) πŸ‘‘


🌸 SYNOPSIS 🌸

#include <zt.h>

#define ZT_CMP_RUNE(left, rel, right) \
  zt_cmp_rune( \
    ZT_CURRENT_LOCATION(), \
    zt_pack_rune((left), (#left)), \
    zt_pack_string((#rel), (#rel)), \
    zt_pack_rune((right), (#right)))

zt_claim
zt_cmp_rune(zt_location location, zt_value left, zt_value rel,
    zt_value right);

no cap, that's the whole thing 🫢


πŸ’– DESCRIPTION πŸ’–

zt_cmp_rune() constructs a claim of a relation between two unsigned integers. bestie, you should use it through the macro ZT_CMP_RUNE() β€” that's the one that passes the source code location and does all the packing for you. πŸŽ€

The relation must be one of ==, !=, <, <=, > or >=. that's it. those six. periodt. ✨


🧚 IMPLEMENTATION NOTES 🧚

ZT_CMP_RUNE() evaluates left and right exactly once. so like, if you were worried about your fancy side-effecty expression getting run twice β€” it does not. slay. πŸ’…


πŸ‘‘ RETURN VALUES πŸ‘‘

Both the macro and the function return a claim structure with the right attributes set. the returned claim is usually passed to zt_check() or to zt_assert(). that's the whole vibe β€” you build the claim, then you hand it off. πŸ“


🌈 SEE ALSO 🌈

(the whole comparison squad fr fr πŸ’œ)


⭐ HISTORY ⭐

The ZT_CMP_RUNE() macro and the zt_cmp_rune() function first appeared in libzt 0.1. baby's first release, iconic behavior. 😭


πŸŽ€ AUTHORS πŸŽ€

Zygmunt Krynicki <me@zygoon.pl> β€” the main character who wrote this. πŸ‘‘


libzt 0.3.1 Β· January 12, 2020 β€” mwah, that's a wrap on ZT_CMP_RUNE(3), go build some claims bestie πŸ¦‹πŸ’–βœ¨