[plt-scheme] How to find the value associated to a symbol via an identifier ?

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Feb 16 17:55:33 EST 2009

On Feb 16, Grant Rettke wrote:
> 
> I see that this is a literal approach:
> 
> #lang scheme
> 
> (define id45 45)
> (define idid 'id45)
> 
> (define-syntax find-symbol-value
>  (lambda (stx)
>    (syntax-case stx ()
>      ((find-symbol-value)
>       (with-syntax
>           ((var (datum->syntax #`find-symbol-value 'id45 #f)))
>         #`var)))))
> 
> (find-symbol-value)

You won't be able to do it this way -- note that your code doesn't use
the value of `idid'.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.