Skip to content
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

define-term in pattern position #215

Open
wilbowma opened this issue Jan 20, 2020 · 1 comment
Open

define-term in pattern position #215

wilbowma opened this issue Jan 20, 2020 · 1 comment

Comments

@wilbowma
Copy link
Collaborator

I usually think of any term being allowed in pattern position and simply acting as "unify with this".

I think of define-term as simply introducing a meta-variable that means literally the term being defined.

However, both of these mental models are broken when combined:

(require redex/reduction-semantics)
(define-language L)
(define-term T true)
> (redex-match? L true (term T))
#t
> (redex-match? L T (term true))
#f
> (define-judgment-form L
    #:mode (eval I O)
    [(eval true true)])
> (judgment-holds (eval T true))
#t
> (judgment-holds (eval T T))
#f

Is there a reason? Could this be supported?

@rfindler
Copy link
Member

That would indeed be better, in this example (and many many similar ones), but the full ramifications of that seem quite subtle. It might be easy to do this but it might also be hard. I'll try to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants