May be the following example may help:
 
In definitions window of DrRacket:
 
#lang racket
(define a 'interned-symbol)
(define b 'interned-symbol)
(define c (string->uninterned-symbol "uninterned"))
(define d (string->uninterned-symbol "uninterned"))
(list a b c d)
(eq? a b)
(eq? c d)
 
Now run it and and inspect the interactions window:
 
(interned-symbol interned-symbol uninterned uninterned)
#t
#f <---- although the two uninterned symbols have the same name.
 
So you see that an uninterned symbol is really unique and will not be
confused with any other symbol of the same name.
I used string->uninterned-symbol in stead of gensym, because
string->uninterned-symbol allows you to exactly provide the name of the
symbol.
 
Jos

  _____  

From: [email protected] [mailto:[email protected]]
On Behalf Of Harry Spier
Sent: miércoles, 17 de agosto de 2011 1:18
To: [email protected]
Subject: [racket] Interned and uninterned symbols


Dear list members,


Could someone expand a little on the reference guides explanation of the
difference between interned and uninterned symbols.  In particular what
exactly is an uninterned symbol?

Thanks in advance,
Harry Spier
-

_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to