::SHE+ILA:: Buffer Flags [$57]

Confident figure in purple gown with spear and flags
99
0
  • Squishy Plushie's avatar Artist
    Squishy Pl...
  • Prompt
    Read prompt
  • DDG Model
    DaVinci2
  • Access
    Public
  • Created
    20h ago
  • Try

More about ::SHE+ILA:: Buffer Flags [$57]

The general representation of a Buf is $EB flagbyte buflength $ED dopevector Datablock $00. We will discuss the flagbyte below. (The buflength is the number of elements in Datablock, and the dopevector is a vector of pointers to each element.)
The flagbyte's LSB indicates whether this Buf contains a symbol table (as the Buf's zeroeth entry, i.e. Buf[0]). The remaining flag bits concern the dopevector and how many bytes it has for each pointer (vaguely like near/far). A setting of 0 means the dope vector is omitted altogether (useful for strings).
Usually you write something like (1, 2, 42, 137) to set up a Buf, this example has four numeric elements. You can of course include nested Bufs, strings, and lambdas, such as (1, 2, "hello", &{ % + 1}, (11, 22)) to any depth. If we want to set the "symbol table present" flag, we include an "=" somewhere in the parentheses, for example (a=1, b=2, foo="hello"). This is useful for declaring local variables in a procedure, for example, or a list of commands in a menu or parser. See many examples in the #sheila hashtag :)

Comments


Loading Dream Comments...

Discover more dreams from this artist