[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] Symbol



   From: pocm@rnl.ist.utl.pt (Paulo J. Matos)
   Date: 18 May 2002 20:38:28 +0100
   Hi all,

   Playing around with symbol names I was surprised with:
   > '{3, 2}
   (3 ,2)

   Why?

This is specific to PLT Scheme, not something that will work that way
in all Schemes.  It is related to the following other examples:

> {+ 3 4}
7
> (equal? ',2 (list 'unquote 2))
#t
> (equal? '{3, 2}
          (list 3
                (list 'unquote 2)))
#t

In other words:

 (1) PLT Scheme is choosing to read {} as the same as (), .

 (2) The comma is a special character, akin to the quote mark, in that
     it causes whatever is after it to be wrapped in an unquote form.

 -max