[fpc-pascal] ++ and --

Sven Barth pascaldragon at googlemail.com
Tue Jul 30 20:10:51 CEST 2013


On 30.07.2013 18:20, Mark Morgan Lloyd wrote:
>> Now specifically to your question - I believe that one of the reasons may
>> be the fact that Pascal does not support unary arithmetic operators in
>> postfix notation. The fact that C allows using them with both prefix and
>> postfix notation makes them even more difficult from my point of view
>> because potentially allowing them only in one of the notations known from
>> other languages would immediately trigger users to ask why only one of
>> possible notations (common elsewhere) is supported and the other not.
>
> I've got a vague recollection that some of the ++ and -- semantics are
> particularly unpleasant, and that one of the C inventors did his best to
> disown them. At least += etc. are fairly unambiguous: they're almost
> macro expansions and as such they don't mandate any extra overloadable
> operators etc.
>

The most important points with these operators is to remember that they 
are once "increase/decrease then return" (prefix) and once "return then 
increase/decrease" (postfix)

Regards,
Sven



More information about the fpc-pascal mailing list