[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-----
Hash: SHA1


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,
etc.

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
to do.

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
write

(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
Forth-ish DSL.

				Bear




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPXwrnAAoJEAOzWkqOibfNbHoH/0h6a+vq79peSB8S73SD84aR
qRkEpN2dW5sRnsjERZizqAZjAxMTdL6nlT5C/6w/OkAorkRs1T4Fb1z3B+LKq1mq
XSXmFMfO7Fk1ak1zg73tJDKuQXIsEOKyRpWEavH2Z6oLXNiU2bfV1gO7xTdVv+fr
ojENq83o0geKxH/TK8J0iowvjpeuzRDj5gTI9yk10Fk6KOLMYRwfRnw+USH/apQ+
0+Qad03IBNqHBLosyrf1C2NEaowB1N8pttgVMc8hC2oMhHkgfXbp2s4zu+r2KrVU
2b17JrE9yldwFwc7dQWQo21QpkTKsoQBkp7V/nPq0xKckUyV3XAjFeV6cQN5CAs=
=fvaR
-----END PGP SIGNATURE-----

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports