> [...]

> 

>In what kind of situation might a library name be made up of identifiers (syntax objects) that might need to carry lexical information?

 

As implied by the previous: never (in Guile, and probably most others).

 

The only exception I can think of, is if:

 

* ‘define-library’/’library’ is implemented as a macro (this is not part of RnRS, but AFAIK neither is it against the standard)

* hence, you can define a module from within another module (might be situationally useful, but comes with new difficulties for module lookup)

* there are multiple module namespaces

* to determine which module namespace to put the module in, ‘define-library’ uses lexical information

* in particular, it uses components of the name of the library for lexical information, even though there are other options like using the _whole_ name (i.e., (foo bar) itself instead of ‘foo’ or ‘bar’).

 

That’s a lot of ifs, and even then identifiers aren’t necessary, since (AFAIK) the name (foo bar) itself carries lexical information (not sure).

 

I’ve been assuming that numbers (in syntax) (say, #'3) don’t carry lexical info, but since ‘syntax numbers’ carry file name+position information, it’s not much of a stretch to potentially also include lexical information, so perhaps numbers would work just fine too! (Implementation-dependent, but ‘multiple module namespaces’ and ‘define-library as a macro’ are also implementation-dependent.)

 

Best regards,

Maxime Devos.