[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
0e as identifier
From: |
Bill Schottstaedt |
Subject: |
0e as identifier |
Date: |
Sat, 2 Jan 2010 04:45:19 -0800 |
I believe r5rs says an identifier can't start with a digit, but
guile allows it to:
scheme@(guile-user)> (symbol? (make-symbol "0"))
#t
scheme@(guile-user)> (symbol->string (make-symbol "0"))
"0"
scheme@(guile-user)> (keyword? (symbol->keyword (string->symbol "0")))
#t
scheme@(guile-user)> (symbol? (string->symbol "0e0"))
#t
which leads one naively to:
scheme@(guile-user)> (let ((0e 1)) 0e)
1
scheme@(guile-user)> (let ((0e0 1)) 0e0)
<error printout>
Not a bug, I guess, but not very pretty.
(r6rs says an identifier "begins with a character that cannot
begin a representation of a number object." I think they meant
"a sequence of characters").
- 0e as identifier,
Bill Schottstaedt <=