[fpc-devel] Strange behaviour of ;

Florian Klaempfl florian at freepascal.org
Sat Oct 22 09:14:53 CEST 2005


Tomas Hajny wrote:
> Date sent:      	Fri, 21 Oct 2005 09:46:05 +0200 (CEST)
> Subject:        	Re: [fpc-devel] Strange behaviour of ;
> From:           	"Peter Vreman" <peter at freepascal.org>
> To:             	"FPC developers' list" <fpc-devel at lists.freepascal.org>
> Send reply to:  	FPC developers' list <fpc-devel at lists.freepascal.org>
> 	<mailto:fpc-devel-request at lists.freepascal.org?subject=unsubscribe>
> 	<mailto:fpc-devel-request at lists.freepascal.org?subject=subscribe>
> 
>>>Marc Weustink wrote:
>>>
>>>>It looks like "+ <some call>" is parsed wrong. The next "program"
>>>>compiles fine.
>>>
>>>Well, the compiler/parser thinks you use the unary + operator which
>>>it can safely throw away :) IIRC TP accepted the unary + operator
>>>for any expression so we did.
>>
>>Delphi doesn't allow it. a single '+ <x>' is not changed implicitly to
>>'0 + <x>' so that there is checking done instead of ignoring the the
>>'+'.
> 
> 
> TP/BP doesn't allow it either:
> 
> Turbo Pascal  Version 7.0  Copyright (c) 1983,92 Borland 
> International
> T.PAS(3): Error 113: Error in statement.
>   + ParamStr(0);

But it allows
s:=+ParamStr(0);
iirc

>   ^
> 
> Tomas
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 




More information about the fpc-devel mailing list