Mon, 8 Nov 1999 13:49:39 +0300 (MSK), S.D.Mechveliani <[EMAIL PROTECTED]> pisze:
> as *any* Haskell compiler understands the programs with the
> expressions like
> "2 + 3 * 2",
> is not it natural to provide a standard function for parsing
> of such things to the value of needed type?
>
> And what the standard provides, is only a poor `lex' function.
For me it's very unnatural that there are show and read functions
having anything common with Haskell source syntax. I don't like show
and read precisely for this reason, and use them only for showing
integers and for debugging messages.
Strange that you think that it would be natural to embed an interpreter
of the same language that was used to write the program in every
program... The format of data a program reads and writes should not
depend on the language the program is written in.
And if a program needs to represent literals of complicated types with
strings to be parsed, for me it's a symptom of either not good enough
language (not permitting writing those constants in a friendly way)
or strange program design. E.g. once I wanted to have in a program
written in C a constant table of lists of argument types of some
commands, each type being INTEGER or STRING, and was disappointed
that encoding those signatures in character strings like "iiiis"
was much more compact than writing arrays of enum {INTEGER, STRING}
- because it is very unnatural for me to have some constants to be
"parsed" (even trivially) at runtime.
I have objections against languages manipulating any source names
during runtime. It's not about performance, only elegance. Source
language and data exchange formats are completely different
worlds. What about static scoping of identifiers?!
I can only accept such things as a part of runtime support for dynamic
linking etc., hidden from the language level, or maybe in simple shell
languages which don't have better types representing actions anyway.
It's probably the same reason I don't like Dynamic: because it tries
to represent source language concepts at runtime using names from
the source, again contradicting static scoping.
--
__("< Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
\__/ GCS/M d- s+:-- a22 C+++>+++$ UL++>++++$ P+++ L++>++++$ E-
^^ W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK 5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-