[plt-scheme] probably dumb question, but...

From: Psy-Kosh (psykosh at earthlink.net)
Date: Mon Jan 3 14:33:44 EST 2005

I was messing around a bit, and discovered something... odd.

consider the following:

Welcome to DrScheme, version 209.
Language: Textual (MzScheme, includes R5RS).
 > ;this is expected:
 > ,a
unquote: not in quasiquote in: (unquote a)
 > ;the rest of this confuses me:
 > ',a
,a
 > (symbol? ',a)
#f
 > (eq? ',a ',a)
#f
 > (eqv? ',a ',a)
#f
 > (equal? ',a ',a)
#t
 > ;hrm, but even though it's not a symbol...
 > (define ,a 37)
 > ,a
. reference to undefined identifier: a
 > a
. reference to undefined identifier: a
 > |,a|
. reference to undefined identifier: |,a|
 > ;so ,a doesn't produce an unquote not in quasiquote error anymore, 
but there doesn't seem to be any way to extract the 37 from wherever it is
 > (set ,a 26)
. reference to undefined identifier: set
 > ;typo
 > (set! ,a 26)
set!: not an identifier in: (unquote a)
 > ;but...
 > (define ,a 26)
 > ;but... but... aren't later defines defined to act equivalently to set! ?
 >

okay, so what exactly is ,a? why if it's not a symbol, why can it be 
used as an identifier for the purposes of define? why not for set! ?

Psy-Kosh



Posted on the users mailing list.