4 ms·
Wouldn’t that match “(foo - bar)” as well as “(foo-bar)”? I don’t think you can get around token whitespace in macro_rules
by throwup238 2y 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
- quasigloam 2y agoYes 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 agoIt would, but lisp has prefix operators, so you wouldn’t have to worry about it getting confused.
- quasigloam 2y agoAlthough 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 agoThe 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)