KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there any way to make simple reader macros in Racket. I mean a generalization like this: (define-reader-syntax "'" quote) ; finds expressions that start with "'" and wraps them in `(quote ...)` '(foo) ; => (quote (foo)) 'foo ; => (quote foo) I used a built in syntax to make clear what I mean. One of the things I'd like to use this for is replicating clojure's shorthand lambda (#(+ 1 %) 5) ; => 6 It seems like it would be very easy to just define a "shorthand-lambda" macro and map the "#" prefix to that.
Tags (comma-separated)
Save Edits
Cancel