[fpc-devel] Proposal: Enhanced replacement for assignment operators

Martin fpc at mfriebe.de
Fri Aug 6 17:34:45 CEST 2010


  On 06/08/2010 16:21, Alexander Klenin wrote:
> On Sat, Aug 7, 2010 at 01:50, Martin<fpc at mfriebe.de>  wrote:
>>   On 06/08/2010 15:45, Alexander Klenin wrote:
>>
>> I don't have a problem with "a mod b" =>  only with "a mod= b"
>>
>> mod is a keyword, it therefore follows the rule (as identifier)  that it
>> consists of certain chars only (a-z, underscore, digits, but not leading)
>>
>> := += are symbols =>  they do not consist of said chars
>>
>> mod= is what exactly?
> Whatever you would like it to be ;-)
> Really, I can see how it may require a special case in the tokenizer,
> but apart from that, who cares?
> > From the syntax highlighting POV, it should IMO be a symbol,
> like "mod" and "div".

It's not about implementation in the fpc parser/compiler, or syntax 
highlighter => you can implement any such thing...

But it's breaking the fundamentals of pascal, to differentiate between 
symbol and identifiers.

Obviously it acts like a symbol does, so it should be a symbol; but if 
symbol can have chars, then why can't identifiers have $+-...
If we give up this barrier, then surely the following should be valid to?
var a$b: Integer;
symbols may need to be surrounded by spaces always, since I also would 
want an identifier/variable named
var a+b : integer;

----------
if there should be a shorthand for "a:=a mod b" => ok => but please make 
it look like pascal.
Either inc style, or symbol style. maybe use "%=" (and "::=" for div 
(first ":" =divide))

I don't say I like those, but "mod=" is just the worst I can imagine.

Martin







More information about the fpc-devel mailing list