-
Notifications
You must be signed in to change notification settings - Fork 37
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
very simple keyword support #65
Comments
Neat! |
As a side note I still think you should keep the existing keyword mechanism (entry in lookup table) because then it allows you to associate meaning to a particular keyword in a particular context, such as |
Agreed - and I don't think there's currently any other useful function for keywords. |
Well, you could do |
earlier I think I mentioned that I implemented generic keywords by automatically wrapping them in
(quote)
in the reader, but that's probably a bad solution if I ever implement macros. I just came up with another solution that is super simple and works with macros:// in eval () if (symbolp(form)) { + if (nthchar(princtostring(form), 0) == ':') return form; // Keyword symbol_t name = form->name; object* pair = value(name, env); if (pair != NULL) return cdr(pair); pair = value(name, GlobalEnv); if (pair != NULL) return cdr(pair); else if (builtinp(name)) return form; Context = NIL; error(PSTR("undefined"), form); }
The text was updated successfully, but these errors were encountered: