ASON_VALUES(3)

πŸ“¦ version 0.1.2, in fedora 43, fedora 44

πŸ’– ASON VALUES πŸ’–

okay bestie, so this is the ASON Values page from section 3 of the User Manuals, and it's literally the cheat sheet for all the cute little constants and type enums that libason hands you for free. no cap, it's giving "starter pack" energy πŸŽ€


✨ NAME ✨

ASON_EMPTY, ASON_NULL, ASON_UNIVERSE, ASON_WILD, ASON_OBJ_ANY, ASON_TRUE, ASON_FALSE β€” Predefined basic ASON value constants πŸ¦‹


✨ SYNOPSIS ✨

first things first, you gotta pull in the header, periodt:

#include <ason/ason.h>

and here are the constants, all of them, looking iconic:

ason_t * const ASON_EMPTY;
ason_t * const ASON_NULL;
ason_t * const ASON_UNIVERSE;
ason_t * const ASON_WILD;
ason_t * const ASON_OBJ_ANY;
ason_t * const ASON_TRUE;
ason_t * const ASON_FALSE;

and the enum that tells you what a value is, because vibes alone aren't enough:

typedef enum {
     ASON_TYPE_NUMERIC,
     ASON_TYPE_EMPTY,
     ASON_TYPE_NULL,
     ASON_TYPE_UNION,
     ASON_TYPE_INTERSECT,
     ASON_TYPE_OBJECT,
     ASON_TYPE_UOBJECT,
     ASON_TYPE_LIST,
     ASON_TYPE_JOIN,
     ASON_TYPE_COMP,
     ASON_TYPE_STRING,
     ASON_TYPE_TRUE,
     ASON_TYPE_FALSE,
     ASON_TYPE_REPR,
     ASON_TYPE_EQUAL,
} ason_type_t;

✨ DESCRIPTION ✨

🌸 Constants 🌸

libason defines several constants for commonly-needed values. it's giving "we already did the work for you, bestie" πŸ’…

  • ASON_TRUE, ASON_FALSE and ASON_NULL β€” these describe the JSON true, false and null values respectively. yes, the classics.
  • ASON_EMPTY, ASON_UNIVERSE and ASON_WILD β€” these describe the empty ASON value, the ASON universe value and ASON wild value respectively.
  • ASON_OBJ_ANY β€” describes a universal object with no keys. no keys, no problems, main character energy fr.
okay important one: ason_destroy(3) has no effect on these ASON constants. so don't be out here trying to destroy them, they're built different πŸ”₯

πŸ¦‹ Types πŸ¦‹

libason defines the ason_type_t enum for identifying types of ASON values. think of it like a vibe check for your data πŸ‘‘

  • ASON_TYPE_NUMERIC, and ASON_TYPE_STRING are for values which are constant numerical or string values respectively.
  • ASON_TYPE_EMPTY, ASON_TYPE_NULL, ASON_TYPE_TRUE, and ASON_TYPE_FALSE are the types of the empty value, and the JSON constants "true", "false", and "null".
  • ASON_TYPE_UNION, ASON_TYPE_INTERSECT, ASON_TYPE_COMP, and ASON_TYPE_JOIN are types of values which are unions, intersections, complementations, or ASON joins of other values.
heads up bestie: libason typically reduces values to simplest form, which should cause intersections and joins to be eliminated. so libason functions should not return those types when inspecting values. it's giving "you'll basically never see these, don't count on it" 😭
  • ASON_TYPE_OBJECT and ASON_TYPE_UOBJECT are the types of normal and universal objects.
  • ASON_TYPE_LIST is the type of list values.
  • ASON_TYPE_REPR, and ASON_TYPE_EQUAL are the types of statements checking for equality or representation between other values.
another lil reality check: libason will usually solve such expressions as soon as they are parsed, so you will likely observe a simple true or false value rather than either of these types. the way it just solves itself immediately... icon behavior πŸ’€βœ¨

✨ SEE ALSO ✨

ason(3) ason_read(3) ason_destroy(3) β€” go read those too, they're part of the lore πŸ“šπŸ«Ά


✨ AUTHOR ✨

Casey Dahlin <casey.dahlin@gmail.com> β€” thank you for your service king/queen/monarch πŸ‘‘πŸ’œ


and that's the whole page, babe. this one shipped on Linux, dated JANUARY 2014, and it's the ASON VALUES(3) page from the User Manuals. slay, stay safe, and remember: don't ason_destroy a constant πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from