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

Re: A different approach

This page is part of the web mail archives of SRFI 75 from before July 7th, 2015. The new archives for SRFI 75 contain all messages, not just those from before July 7th, 2015.



felix winkelmann wrote:
On 7/18/05, Thomas Lord <lord@xxxxxxx> wrote:

    It has never been great style in Scheme, even if strictly portable, to
write programs which assume that string->symbol and symbol->string define a
1:1 relationship between the two types.

I'm probably missing something obvious, but this strikes me as quite
nonsensical.
Could you elaborate?

The culprit is uninterned symbols:

> (let ((foo 'foo))
    (eq? (string->symbol (symbol->string foo))
      foo))
#t

>(let ((foo (string->uninterned-symbol "foo")))
  (eq? (string->symbol (symbol->string foo))
    foo))
#f

--
Jens Axel Søgaard