unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Seeking Understanding about Symbols, Strings, Structure and Storage
@ 2009-11-06  9:54 Nordlöw
  2009-11-06 12:03 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 2+ messages in thread
From: Nordlöw @ 2009-11-06  9:54 UTC (permalink / raw)
  To: help-gnu-emacs

I am trying really hard to get a unified view about all the atomic
types and containers/structures/links (e)lisp provides me with:

What is the best (efficient) way to store symbols (references)
extracted from an obarray?
Should I intern them in a new array or should I store them in a
sequence?
Does interning symbols in an obarray require more memory than storing
them in a vector?
When should I intern symbols in an obarray?; My guess: When I need
fast (hashed) lookup of them.
If I store symbols in a list, say '(a b), are these symbols "free",
compared to if I first intern them?

I have heard the we should always prefer symbols before strings, when
we can. Why?;
I guess symbols require less memory because they don't carry string
attributes. Are the any other reasons?

If I want to build a tree or even a cyclic graph (I guess this is
possible because there are rings) do we always need to construct these
from cons-cells?
If so how do we realize this?: I know that setcar,setcdr,setf can play
a key-role here. What happens if I try to print such an expression
using princ(), prin1()?

For example how should we efficiently store a parse tree of tokens
having properties?:
My suggestion: As a cons-tree of symbols were the symbols are interned
in an obarray having properties accessed using get() and put().

If I assign the same long symbol to many variables is it assigned by
reference, kind of like pointers in C? Example:
  (setq x 'loooooooooooooooooooong y 'loooooooooooooooooooong)

Is there some web-page out there that highlights the choices the (e)
lisp designers made concerning these things?

Thanks,
Nordlöw


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-06 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-06  9:54 Seeking Understanding about Symbols, Strings, Structure and Storage Nordlöw
2009-11-06 12:03 ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).