Y
Hacker News
new
|
ask
|
show
|
jobs
by
throwup238
636 days ago
Wouldn’t that match “(foo - bar)” as well as “(foo-bar)”? I don’t think you can get around token whitespace in macro_rules
2 comments
quasigloam
636 days 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.
link
celeritascelery
636 days ago
It would, but lisp has prefix operators, so you wouldn’t have to worry about it getting confused.
link
quasigloam
636 days 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.
link
tmtvl
636 days 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)
link