Hacker News new | past | comments | ask | show | jobs | submit login

Well, I was about to say, the Common Lisp version makes enough sense (and the MacLisp version might be equivalent, for all I know):

In CL, you don't really have a global "symbol table" or "atom table"; instead, interning is about the runtime lexical scopes under which code compilation happens, which consist of stacks of imported namespaces ("packages"), where each namespace exists as a mutable object holding identifier "slots".

(intern foo) is a mutation on the current namespace that creates a local variable "slot" for the identifier foo, shadowing any other foo that might have been in lexical scope from an import. That is, (intern foo) makes foo resolve internally to the current namespace.

(unintern foo) is the complementary mutation; it drops the foo identifier from the current namespace, allowing other symbols (slots in packages) that were previously shadowed by it to re-appear.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: