Re: New syntax: (: MODULE-NAME VARIABLE-NAME)

From:

Neil Jerram

Subject:

Re: New syntax: (: MODULE-NAME VARIABLE-NAME)

Date:

16 Nov 2003 18:38:24 +0000

User-agent:

Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Marius" == Marius Vollmer <address@hidden> writes:
Marius> Hmm, I would find it more natural to have a separate macro, like
Marius> (:: MOD-NAME VAR-NAME)
Marius> where '::' would be the (to me) obvious choice of name.
Marius> Unfortunately, with (read-set! keyword 'prefix) that name would be a
Marius> keyword...
Sorry that my thoughts on this are coming out in such a trickle!
I just noticed, though, that there are some other symbols (than :)
available that don't have other meanings and which could be understood
as relevant to a module lookup:
(@ MOD-NAME VAR-NAME)
Seems quite good, with @ meaning `at' as in `in the specified module'.
($ MOD-NAME VAR-NAME)
Tenuous link to $'s use in many languages for variable reference.
Clashes with not-yet-widespread use of $ for value-history, though.
(. MOD-NAME VAR-NAME)
Intuitively very similar to : IMO, but without the keyword issues.
However, (i) some people might want `.' for the mathematical dot
(scalar) product; (ii) Guile currently seems confused about whether
`.' is a symbol:
guile> .
ERROR: Unbound variable: .
ABORT: (unbound-variable)
guile> '.
.
guile> (define . 1)
ERROR: In procedure memoization:
ERROR: In line 3: Bad expression (define . 1).
ABORT: (syntax-error)
(? MOD-NAME VAR-NAME)
Quite nice, ? meaning a query, so a lookup.
Of these, I like @ the most.
Neil