Assignment Versus Equality

Marko Rauhamaa marko at pacujo.net
Mon Jun 27 10:09:22 EDT 2016


Grant Edwards <grant.b.edwards at gmail.com>:

> On 2016-06-26, BartC <bc at freeuk.com> wrote:
>
>> (Note, for those who don't know (old) Fortran, that spaces and tabs
>> are not significant. So those dots are needed, otherwise "a eq b"
>> would be parsed as "aeqb".)
>
> I've always been baffled by that.
>
> Were there other languages that did something similar?

In XML, whitespace between tags is significant unless the document type
says otherwise. On the other hand, leading and trailing space in
attribute values is insignificant unless the document type says
otherwise.

> Why would a language designer think it a good idea?
>
> Did the poor sod who wrote the compiler think it was a good idea?

Fortran is probably not too hard to parse. XML, on the other hand, is
impossible to parse without the document type at hand. The document type
not only defines the whitespace semantics but also the availability and
meaning of the "entities" (e.g., © for ©). Add namespaces to that,
and the mess is complete.


Marko


More information about the Python-list mailing list