On comma, if comma is the first character, the code is expanded into
(unquote ...), but otherwise it is accepted in a name (like #\# and
others):
<1> (define a,b 43)
43
<2> a,b ; a,b is a legitimate symbol
43
<3> (define a#b 32)
32
<4> a#b ; the symbol a#b
32
<5> #ab
#ab ; the undefined object #ab (like #<ab>)
<6> (undefined? #ab)
#t
<7> ',b
(unquote b) ; no error because it's not evaluated
I don't know if this is how other Schemes work. It's possible
for two objects in a sort to be eq? if, for example, you're
sorting integers. I think it is up to each scheme implementation
to decide whether small integers are eq? to themselves (they're eqv?).
Some implementations predefine (say) 1000 ints from 0..999 and
the reader returns them directly (to save on allocations and so on).
In s7, nothing is guaranteed (sometimes s7 does allocate another
integer with the value 0, for example), but normally:
<1> (eq? 1 1)
#t
<2> (eq? 123123 123123)
#f
You can set NUM_SMALL_INTS to change this from the default of 8192.
The (A 0) case should be the same as (car A).
I'll check out this bug tomorrow -- thanks very much for
the bug report!
_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist