From: ············@gmail.com
Subject: packages for strings
Date: 
Message-ID: <1108930947.927905.157860@c13g2000cwb.googlegroups.com>
Hi,

is it a good practice to use packages to intern strings in a program?
Or should one use a hash table instead?

David

From: Peter Seibel
Subject: Re: packages for strings
Date: 
Message-ID: <m3u0o7rn7l.fsf@javamonkey.com>
·············@gmail.com" <············@gmail.com> writes:

> Hi,
>
> is it a good practice to use packages to intern strings in a program?
> Or should one use a hash table instead?

If you don't need any of the special facilities provided by packages,
I think it'd be clearer to use a hashtable and an INTERN-WHATEVER
function. Also you can't make an anonymous package so if you use a
package you'll have the problem of what to name it.

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Marco Antoniotti
Subject: Re: packages for strings
Date: 
Message-ID: <nooSd.26$fp1.48359@typhoon.nyu.edu>
············@gmail.com wrote:
> Hi,
> 
> is it a good practice to use packages to intern strings in a program?
> Or should one use a hash table instead?
> 

It depends on the application.

However, I just had an application where I initially stored strings as 
such.  It turns out that these strings really are unique identifiers 
(Gene Ontology terms, for those who care.)  INTERNing them in a package 
was a huge win.  Far less memory was used and hash table lookups on 
these terms used as keys could be done with EQ.

Again, it depends on the application, my case was one where INTERNing 
the strings just got me quite an improvement in time and space.

Cheers
--
Marco
From: Bulent Murtezaoglu
Subject: Re: packages for strings
Date: 
Message-ID: <87wtt1x2mh.fsf@p4.internal>
>>>>> "MA" == Marco Antoniotti <·······@cs.nyu.edu> writes:
[...]
    MA> However, I just had an application where I initially stored
    MA> strings as such.  It turns out that these strings really are
    MA> unique identifiers (Gene Ontology terms, for those who care.)
    MA> INTERNing them in a package was a huge win.  Far less memory
    MA> was used and hash table lookups on these terms used as keys
    MA> could be done with EQ. [...]

Hmm, mu immediate thought: just hanging the info keyed off the string
(including a flag for whatever hash table they would have belonged to
in your scheme) from the interned symbol's plist would have worked and
would have saved you the hash table.  What am I missing?

cheers,

BM