On 23 Aug 2009, at 10:38 pm, John Cowan wrote:

The idea is to speed up string lookups.  Currently the a-list maps
strings
to values, which means I must use assoc to search it.  If it mapped
symbols to values instead, I could use the faster assq.  I'd rather
intern
the strings once and have done, but I don't want to cause a memory
leak.

Furthermore, the string I'm looking for is sometimes derived from
symbol->string, so I actually have a symbol to start with.  This is
probably true for the majority of lookups, though not the majority
of entries.

Ah, OK. When you spoke of "random" symbols, I had a fear you were
generating symbols with (eg) sequential numbers as names or something
similarly meaningless, just to get a 'comparison token'.

ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/archives/author/alaric/





_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to