ZT_FALSE(3)

πŸ’– ZT_FALSE(3) πŸ’–

okay so bestie, welcome to ZT_FALSE(3) from the LOCAL manual section β€” she's a lil macro and a lil function and she has ONE job and she does it flawlessly. no cap. πŸŽ€


✨ NAME ✨

ZT_FALSE, zt_false β€” construct a claim that a value is false 🫢


🌸 SYNOPSIS 🌸

#include <zt.h>

#define ZT_FALSE(value) \
  zt_false( \
    ZT_CURRENT_LOCATION(), \
    zt_pack_boolean((value), #value)) \

zt_claim
zt_false(zt_location location, zt_value value);

πŸ’… DESCRIPTION πŸ’…

zt_false() builds you a claim that some value you handed over is false. that's it. that's the whole vibe.

okay but listen β€” you're supposed to use her through the macro ZT_FALSE(), not by calling the function directly, because the macro is the one that scoops up your source code location and packs the argument for you. she does the errands. let her. ✨

so where does zt_false() actually shine? when you wanna check custom properties by running your own arbitrary verification logic. main character move, honestly. the tradeoff though (and we gotta be real about this) is that when it fails, the error message can't precisely explain what the problem was. it just says "not false, bestie" and shrugs. 😭 so if you need a good error message, that's a different tool's job.


🧚 IMPLEMENTATION NOTES 🧚

ZT_FALSE() evaluates value only once. one and done. no double-dipping, no surprise side effects running twice. iconic behaviour, we love to see it. πŸ’–


πŸ‘‘ RETURN VALUES πŸ‘‘

both the macro and the function hand you back a claim structure with all the right attributes set. and then you usually pass that claim straight into zt_check() or zt_assert(). it's giving assembly line. πŸ¦‹


🌈 SEE ALSO 🌈

(the original list ends with a trailing comma after zt_check(3), and honestly? she's keeping it. periodt.)


πŸ“œ HISTORY πŸ“œ

the ZT_FALSE() macro and the zt_false() function first appeared in libzt 0.1. baby's first era. 🍼✨


πŸ’œ AUTHORS πŸ’œ

Zygmunt Krynicki <me@zygoon.pl> β€” shoutout to the legend, thank you for your service 🫑🌸


and that's the whole page, bestie!! this lil doc came to you from libzt 0.3.1, dated January 12, 2020. go forth and assert that things are false πŸ’…πŸŽ€