(e-mail address removed) (Kaz Kylheku) wrote in message
[ ... ]
Ambiguous means I have to look up a bunch of hidden rules that were
added to an ambiguous language and arbitrarily resolve the parsing
conflicts.
Okay, so we no longer have to wonder: you clearly don't know what
ambiguous means!
By the way, look at the ridiculous grammar factoring that's needed in
order to avoid the use of explicit precedence and associativity rules.
The expression 42 ends up being a multiplicative-expression *and*
an additive-expression at the same time. Yet it neither adds nor
multiplies.
I find this a bit interesting, but I'm afraid I'll have to wait until
after work to look it up, since my copy of the standard is at home.
[ ... ]
I'm almost certain that Japanese is full of ambiguities, being a
natural language.
Probably true -- but the ambiguities are due to the definition (or
lack thereof) of the language, not my ignorance.
The difference is that there aren't any hidden rules about it.
Hmm...your definition of "hidden" seems to be a strange one. The rules
(grammatical and otherwise) for C++ are all contained in a single
standard. For English there's no single standard specifying all the
grammatical rules, and probably not even one book directory to point
to all the other books that contain all the rules. To me, this seems
far more a matter of "hidden rules". I suppose Japanese may be better
than English in this regard (most languages are, after all) but I
still doubt that they're all in one place or anything like it.
An
ambiguity in natural language doesn't pretend to be something else.
That simply makes it sound remarkably as if you have little or no
experience with real life or natural languages at all. Just for
example, I'd guess that at least 60% of all the law suits filed on
earth are based on contrat language that pretended to be something
else, but was (in retrospect) clearly ambiguous.
If you utter something ambiguous that leads to a misunderstanding, you
can't claim superiority by referring the poor victim of your
misunderstanding to an associative precedence chart.
I see. I guess there are no contract attorneys (or probably any kind
of attorneys) in your world?
[ ... ]
Suppose that an alien encounters a message from Earth which looks like
A + B * C / D - E * F
The alien might be able to deduce what the operators are, and then it
is stuck.
I probably shouldn't try to argue this one, since (based on your
comments above) you seem to be from a planet substantially different
from the one where I live, so you probably have considerably more
knowledge of being that are comletely alien, at least to me.
I guess in the end, if your position is that Lisp might be more useful
for aliens, so be, I won't try to argue the point. The fact remains
that by the time most people start to program, something like "a+b*c"
already has meaning for them, and completely ignoring that background
(and in fact basically requiring that they UNlearn the useful
knowledge they already posess) does NOT improve understanding.
Now the same alien receives:
(- (+ A (/ (* B C) D)) (* E F))
Aha, it's obvious that the two symbols ( ) are special and that they
serve to enclose, as suggested by their shape. Moreover, they balance,
which reinforces that suspicion.
You start by postulating a being of which we know absolutely nothing,
but then postulate that you can provide an accurate prediction about
what it'll find obvious.
I'm not sure whether to believe that you're unbelievably coneited, or
merely insane.
What, like evaluation orders?
No, of course not. Which part of "syntax" didn't you understand?
That's not pure syntax, but semantics.
Oh, so it wasn't lack of understanding, just a lousy attempt at a
straw man.
That's a whole different pile of unbelieveable idiocy that should have
been fixed long ago.
You do nobody (especially yourself) any favors by claiming any
decision with you happen to disagree as "unbelievable idiocy".
Or, I'm guessing that perhaps by ``pure syntax'' you mean ``just the
raw grammar, with no symbol table information''. As in, what is this:
(a)(b)(c)+(d);
I'm not sure this is the simplest or best-chosen example, but at least
it IS an example of what I mentioned, yes.
[ ... ]
With my package, I could write the getc() macro call such that when
the first time it is evaluated, the enclosed expression is parsed and
classified. If it is found to have side effects, like getc(stream++)
then the program stops with an assertion. If it's suspected to have
side effects, a warning is produced and the program continues, and of
course if there are no side effects, it is silent. In both these
cases, the expression is stored into a hash table so it doesn't have
to be parsed again; the next time that same call is evaluated, the
hash will tell that all is good.
I guess I can see where this would be a stimulating intellectual
project, but I'm hard put to conceive of a lot of useful purposes for
it.
So as you can see, I have done some incredibly devilish things in
order to make a dumb language safer.
....or at least think you have. It sounds to me like an awful lot of
work with little real benefit, but if you're happy with what you did,
more power to you.