Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
throwup238
· 2y ago · 0 comments
Wouldn’t that match “(foo - bar)” as well as “(foo-bar)”? I don’t think you can get around token whitespace in macro_rules
Comments
[–]
quasigloam
2y ago
Yes it would match both, this would require us to assume that "foo - bar" can only be an atom. It's not a great solution.
[–]
celeritascelery
2y ago
It would, but lisp has prefix operators, so you wouldn’t have to worry about it getting confused.
[–]
quasigloam
2y ago
Although in a Lisp such as Scheme, you could pass around the negation operator in something like (map - '(1 2 3)), so it would be a valid concern that it might clash.
[–]
tmtvl
2y ago
The problem with that is that there are spaces between map, -, and '(1 2 3). The only way to get spaces into a name is by using vertical bars:
(defvar |do i 10| 1.100)