Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reader conditionals. #54

Open
sstanfield opened this issue Feb 1, 2021 · 0 comments
Open

Add reader conditionals. #54

sstanfield opened this issue Feb 1, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sstanfield
Copy link
Member

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

@sstanfield sstanfield self-assigned this Feb 1, 2021
@gpwclark gpwclark added the enhancement New feature or request label Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants