[plt-scheme] [redex] extending variable-except

From: Casey Klein (clklein at eecs.northwestern.edu)
Date: Tue Jan 5 08:45:47 EST 2010

On Tue, Jan 5, 2010 at 6:58 AM, Keiko Nakata <keiko at kurims.kyoto-u.ac.jp> wrote:
> Hi,
>
> As I extend a language in plt redex, I want to add to symbols, which
> must be excepted from variables. But, if I understand, I cannot extend
> the variable-except pattern with new keywords; can I? If I cannot,
> why?
>

If you use `variable-not-otherwise-mentioned' instead of
`variable-except', the extended language will inherit the base
language's keywords:

(define-language L
  (e (λ (x) e)
     (e e)
     x)
  (x variable-not-otherwise-mentioned))

(redex-match L e (term λ)) ; => #f

(define-extended-language M L
  (e ....
     (set! x e)))

(redex-match M e (term λ)) ; => #f
(redex-match M e (term set!)) ; => #f

Will that work for you?


Posted on the users mailing list.