[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Formal Comment: Change syntax of symbols from |<symbol element>*| to #"<string element>*"
-----BEGIN PGP SIGNED MESSAGE-----
string->symbol can create symbols from strings which are not in the
usual lexical space of symbols (eg, strings that would normally be
interpreted as numbers or delimiters, strings which contain spaces,
symbol->string, when applied to such symbols, must return the same
string that was an argument to string->symbol.
Does the standard really need to specify a read/write syntax for
such symbols? I tend to think that specifying that symbol->string
and string->symbol are inverses is actually all the standard needs
Because in writing portable code, I tend to think that if I really
want to specify a symbol whose name contains a space, I would rather
(string->symbol "Foo bar")
because it is drastically more clear in both intent and syntax, as well
as more reliable across all implementations, than any of the escaped
symbol notations under discussion.
While arbitrary strings can need to be converted to symbols and back
during execution of code, I'm not able to coming up with any
scenario that requires their use in source code.
FWIW, my own toy implementation treated the vertical bar as a symbol,
and I have used it as a function name for a row polymorphic catenative
application operator: It was basically a cheap trick to create a
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
Scheme-reports mailing list