Cannot specify an ellipsis for syntax-rules #706
Labels
No labels
UX
active development
backlog
blocker
bootstrap
bounty
bug
dependencies
discussion
documentation
duplicate
enhancement
flaky test
help wanted
invalid
javascript
question
release
tendentious
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mighty-gerbils/gerbil#706
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In R7RS,
syntax-ruleshas an optional extra argument to specify the term to use for the ellipsis. https://index.scheme.org/filterset/r7rs_small/%28scheme%2520base%29/syntax-rulesThis does not seem to be handled correctly by Gerbil.
Yeah, iirc it was in my todo list but never got around implementing it.
Care for a pr? It shouldnt be all that hard.
We can also just document it as a limitation, waiting for the next hacker to be annoyed enough to fix it ;)
Ah btw,
:::is a keyword!So you should
|:::|or use an identifier.I think this is not a bug?
Using a keyword is wrong, but still, custom ellipsis is not implemented atm. It is not a bug per se, more of an omission, that is readily fixable.
I will try to fix it for v0.18.2.
You can also give it a go if you want!
I found a way to workaround this
I looked at the code in
core.scmand I don't know what I was looking at.it seems to be something like this:
It needs to be supported by syntax-case, it is in src/gerbil/expander/stxcase.ss
It seems like i just need to replace
ellipsis?with a custom one. Is the symbol lexical in Gambit? Can I just replace that somehow?yes, it is simple.
Add an optional argument for the ellipsis? procedure, defaulting to the real ellipsis?.
You will the have to change the syntax-rules macro a bit to recongize and pass the parameter as free-identifier=? the user's identifier.
is it possible to nest ellipsis somehow?
for example:
yes,
(... ...)I don't know enough about Gerbil to patch this. Is it possible to rewrite the body before it is sent to
src/gerbil/expander/stxcase.ss?nah, no need. I will add it to my todo list.