[fpc-devel] Proposal: Multiple assignments

Sven Barth pascaldragon at googlemail.com
Sat Aug 7 14:47:20 CEST 2010


On 06.08.2010 11:34, Mark Morgan Lloyd wrote:
>> Although "a=b=c" is more like "assign c to b and assign (the new value
>> of) b to a" (but it might work in C as well that way).
>
> Please excuse a comment from a non-developer but I really don't like
> this form. I've coded a number of parsers for script languages etc. and
> in general provided that you don't allow multiple assignment you can
> always work out unambiguously whether you're looking at an assignment or
> a test for equality, even without mandating distinct tokens.

Well... in C a test for equality is always "==". So, when reading it 
(and not having read a Pascal code some minutes before :P ) one should 
recognize without problems whether it's an assignment or a comparison 
expression (it's another story that many people - including me - don't 
recognize it that easily ^^)

Regards,
Sven



More information about the fpc-devel mailing list