Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
throwup238
1y ago
0 comments
Share
Wouldn’t that match “(foo - bar)” as well as “(foo-bar)”? I don’t think you can get around token whitespace in macro_rules
0 comments
default
newest
oldest
quasigloam
1y 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
1y ago
It would, but lisp has prefix operators, so you wouldn’t have to worry about it getting confused.
quasigloam
1y 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
1y 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)
j
/
k
navigate · click thread line to collapse