[plt-scheme] variable or syntactic binding

From: Sam TH (samth at ccs.neu.edu)
Date: Fri Dec 18 09:30:14 EST 2009

`syntax-local-value' is useful here:

#lang scheme

(define-syntax m 5)
(define n 6)

  (printf "slv: m ~a~n" (syntax-local-value #'m (lambda _ #f)))
  (printf "slv: n ~a~n" (syntax-local-value #'n (lambda _ #f))))

On Fri, Dec 18, 2009 at 9:16 AM, Jos Koot <jos.koot at telefonica.net> wrote:
> Examining an id-stx in syntax-case, is it possible to find out if it has a
> variable binding or a syntactic binding? I have not found any info on this
> in the docs. I have tried procedures identifier-binding and
> identifier-transformer-binding. The former returns a true value for an
> id-stx with a syntactic binding. The latter returns false for such an
> id-stx. The expander does have to know the difference, I suppose.
> Thanks, Jos
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

sam th
samth at ccs.neu.edu

Posted on the users mailing list.