[plt-scheme] Switching to Scheme
On Jul 3, Matt Jadud wrote:
>
> FWIW, I tend to use symbols and integers for keys. You can get from
> strings to symbols with 'string->symbol', and from lists to symbols
> with... (string->symbol (list->string <ls>)). The latter looks expensive
> in the long run. If you're able to, just use symbols in the first place.
> I've often used integers for keys, but perhaps someone can tell us
> whether this is a good idea or not for hash tables using 'eq?' as an
> equality test.
It works for "small" integers -- until you get beyond `fixnums', on a
32-bit OS:
> (expt 2 30)
1073741824
> (eq? 1073741824 1073741824)
#f
> (eq? 1073741823 1073741823)
#t
On a 64 bit platform "small" is much bigger... (And the 32-bit limit
is fine, since MzScheme won't work on 16-bit platforms. ("fine" if
you stick with MzScheme.))
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!