Re:Google Common Lisp style guide
by reitzensteinm on Saturday July 11, 2020 @09:15PM
(#23807766)
That seems like a bad idea, since you've now got two symbols with the same name that'll fail eq? Is this ever actually done?
Interesting that gensym returns uninterned symbols, thanks.
The uninterned symbols don't fail EQ if they are the same identical symbol.
Re:Google Common Lisp style guide
by reitzensteinm on Sunday July 12, 2020 @03:33AM
(#23809579)
Great, thanks for filling me in. Any idea why the Google guide is against using them for this purpose?
What does the guide say?
Keep in mind that this is a guide from a Lisp using company (bought by Google) who wrote specifically two large applications partly, but significantly, in Lisp: a search engine for flight travel and an airline reservation system. Other application teams may have different rules&requirements, given that they may use Lisp in very different ways.
Re:Google Common Lisp style guide
by reitzensteinm on Sunday July 12, 2020 @05:07AM
(#23810016)
I'm sorry, my question was based on a four day old memory from the main thread that doesn't reflect what the guide says. It just says don't intern symbols at runtime. Presumably you can pass some kind of a flag to the reader to read lisp data structures without interning the symbols that it reads?
I know the story of ITA well, it and PG's writings are what got me interested in lisp in the first place. Which makes me feel old. But not comp.lang.lisp old, it's all relative!
Though a typical use is in macros, where macros introduce new symbols and these should never clash with any existing symbol and to which there should be no access via the name.
Example: A macro which writes the form, the value and which returns the value. GENSYM generates a named/counted uninterned symbol.
If we look at the expanded code of an example, we can see uninterned symbols: We can also let the printer show us the identities of these symbols, labelling objects which are used multiple times in an s-expression: Thus we can see above that it's just one uninterned symbol used in three places.Example run: