John Cowan <xxxxxx@mercury.ccil.org> schrieb am So., 26. Juni 2016 um 23:40 Uhr:
Marc Nieper-Wißkirchen scripsit:

> An implementation may intern symbols lazily.

Can you explain how that is done?

I have no implementation for this. If I had to implement a behaviour like this, I would simply wait with interning symbols until they are used for the first time with eq?.

This has the following two implications:

1) eq? cannot be a simple pointer comparison anymore because it has to check the case for not yet interned symbols first.

2) eq? does not run in O(1) time anymore, but does run in O(1) after the first call. This can probably made into O(1) amortized by interning symbols not as a whole but interning them gradually. [Note that R7RS does not make a guarantee for the running time of eq?.]
 
Chances that long texts end up in the symbol table are low because no one with portability in mind would compare SRFI 135 texts with eq?.

Anyway, even if there is no such implementation: When SRFI 135 makes no guarantee about the relationship between symbol? and text? except for that every symbol is also text, one can use symbol datums for the external representation of texts.

Marc