Discussion:
[VM] uninterned symbols
Julian Bradfield
2011-12-30 16:13:39 UTC
Permalink
Can somebody tell me why VM makes all this use of uninterned symbols
to store bits of data?
It's not an idiom I've seen much elsewhere, and I'm not quite sure
what the point is.
Uday Reddy
2011-12-30 17:15:59 UTC
Permalink
Post by Julian Bradfield
Can somebody tell me why VM makes all this use of uninterned symbols
to store bits of data?
It's not an idiom I've seen much elsewhere, and I'm not quite sure
what the point is.
Do you mean the symbols interned in obarrays?

It just uses them as a hash table. I believe that those were the only hash
tables available in elisp when VM was written. I thought of converting them
to regular hash tables several times, but it is a big task and kind of
pontless.

Are you running into some trouble with these symbols?

Cheers,
Uday
Julian Bradfield
2011-12-30 20:26:04 UTC
Permalink
Post by Uday Reddy
Post by Julian Bradfield
Can somebody tell me why VM makes all this use of uninterned symbols
to store bits of data?
Do you mean the symbols interned in obarrays?
No, I mean, for example, the reverse link in the message list, where
instead of the reverse link being an entry in the message struct, the
message struct has an entry whose value is (make-symbol "<--"), and
then the actual reverse link is stored on that symbol.
Post by Uday Reddy
Are you running into some trouble with these symbols?
No; I'm just curious, because I don't see what the point is.
Julian Bradfield
2011-12-30 21:11:30 UTC
Permalink
Post by Julian Bradfield
No, I mean, for example, the reverse link in the message list, where
instead of the reverse link being an entry in the message struct, the
message struct has an entry whose value is (make-symbol "<--"), and
then the actual reverse link is stored on that symbol.
Actually, I now see the source says:
;; We use an uninterned symbol here as a level of indirection
;; from a purely self-referential structure. This is
;; necessary so that Emacs debugger can be used on this
;; program.

but I don't understand this anyway!
I don't see any obvious problems with debugging looped data structures
in XEmacs.

Loading...