SDL enumerated types and constants are passed and returned as symbols,
thus enforcing their "constant" nature and for ease of use in
case statements. Flags, such as the SDL initialization flags
and video surface flags, are treated as lists of symbols, each
constant in the flag group that you would
or together in C code
becoming a symbol in the list.
Some of these symbols retain their exact C names, while others are adapted to better fit Scheme (mostly by removing the ‘SDL_’ prefix, changing underscores to hyphens, downcasing, and inserting a hyphen between “words”).
A particular set of enums is called an enumstash. Likewise flagstash for flags.
You can use
kotk to examine the enums and flags encapsulated by
these respectively typed objects.
also use integers where enums/flags are expected, and can convert between the
symbol and numeric value with
The conversion procs all take stash as the first argument, a symbol that identifies the particular set of enums/flags. For backward compatibility, stash may also be such an object, but this support will be removed after 2013-12-31, when those objects are to be fully internalized.
Return the contents of stash name (a symbol), as an alist with symbolic keys, integer values. If name is omitted, the keys are the names of the all the enum- and flagstashes, and the values have the form:
where n is the count of symbols in that stash,
and type is a symbol:
Return the number in stash associated with symbol.
Return the symbol associated with number, or
if it does not belong to stash.
Use stash to convert flags to a number.
flags is a list of symbols;
#f, which is taken as the empty list;
#t, which is taken as the list of all
possible symbols in stash.
Use stash to convert number to a list of symbols. If the flags in stash are not sufficient to decode number, the first element of the list is the numeric remainder.
Conversion from symbols to numbers (including
flags->number) throws an error with key
if the specified symbol is not a member of the respective enumstash or