sl-sh-dev/sl-sh

Add reader conditionals.

Opened this issue · 0 comments

Add the following reader macros (built in most likely) for conditional reads.
#_expression
Ignore the next expression, can be an atom or list.

#+feature form
If feature is true,'' then this syntax represents a Lisp object whose printed representation is form. If feature is false,'' then this syntax is effectively whitespace; it is as if it did not appear.
The feature should be the printed representation of a symbol or list. If feature is a symbol, then it is true if and only if it is a member of the list that is the value of the global variable features.
Otherwise, feature should be a Boolean expression composed of and, or, and not operators on (recursive) feature expressions.

#-feature form
Like #+(not expr)

Note may need *read-suppress* or equivalent to support this. Pay attention to interactions with "#.".

References:
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node191.html
http://www.lispworks.com/documentation/HyperSpec/Body/v_rd_sup.htm