-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R7RS does not support underscore as a keyword in syntax-rules #413
Comments
I don't think that behaviour is specified in the standard though. |
Also note that there is a predicate bound at phi=1 which you can use to test for underscores: |
@vyzo I don't think it is either--actually, when I CTRL-F the R7RS document for But there's good reason to support using |
There is no need for much trickery, you can use a fender in the syntax-rules pattern.
|
Btw, why don't you just use the native match on Gerbil? |
@vyzo Because I'm writing an application in R7RS so that it can be portable to as many platforms as possible, and as many Schemes as possible. I don't want to use any Gerbil-specific features in the portable parts of the code. I'm not using Gerbil for Gerbil's syntax, I'm using it because it's an R7RS Scheme that compiles to fast native code. |
That's totally fine, Gerbi is a meta-language after all. |
In other R7RS schemes, it is possible to define a keyword named
_
insyntax-rules
, and that keyword will be detected in pattern matching. Gerbil appears to always reserve_
as a wildcard, even if it has been named as a keyword.For example, this script
underscore-keyword.scm
:Gauche and Chibi match the first case when passed the literal symbol
_
, and the second case otherwise; they print(#t #f)
. But Gerbil treats the_
as a wildcard and always matches the first case; it prints(#t #t)
.The text was updated successfully, but these errors were encountered: