We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Unquoted matches, that is, $ matches in a '' pattern, are not available within that pattern, even to later subpatterns. For example,
$
''
#lang rhombus/static '1 2' is_a matching( '$(first_int :: Int) $(pattern: kind ~term | '$(second_int :: Int)': match_when first_int.unwrap() == second_int.unwrap())' )
this program does not work, nor does
#lang rhombus/static syntax_class SomeInt(int): kind ~term | '$(this_int :: Int)': match_when this_int.unwrap() == int '1 2' is_a matching( '$(first_int :: Int) $(_ :: SomeInt(first_int.unwrap()))' )
In contrast, the corresponding Racket program
#lang racket/base (require syntax/parse) (syntax-parse #'(1 2) [(first-int:integer (~and second-int:integer (~fail #:unless (eqv? (syntax-e #'first-int) (syntax-e #'second-int))))) #t] [_ #f])
works just fine.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Unquoted matches, that is,
$
matches in a''
pattern, are not available within that pattern, even to later subpatterns. For example,this program does not work, nor does
In contrast, the corresponding Racket program
works just fine.
The text was updated successfully, but these errors were encountered: