On 3/04/20 3:22 pm, Guido van Rossum wrote:
This allows more freedom in designing a grammar. For example, it would let a language designer solve the "dangling else" problem from the Wikipedia page, by writing the form including the "else" clause first .

I'm inclined to think that such problems shouldn't be solved at the
parser level, but rather at the language level, i.e. don't design
the language that way in the first place. After all, if it's
confusing to the computer, it's probably going to be confusing
to humans as well.

(I note that all of Wirth's languages after Pascal changed the syntax
so as not to have a dangling else problem.)

Personally I would rather my parser generator *did* complain about
ambiguities, so that I can facepalm myself for designing my language
in such a stupid way.

--
Greg
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/MKMIDLTI3U7WKJ6PPMHNRQBVZINCJJAQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to