Bill Allombert on Thu, 24 Oct 2002 14:55:42 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Parser problem


> I'd rather skip the side effects, than the way type "s" works.
> In any case, it is difficult to change this without losing backward
> compability, and i guess a majority of scripts will break if you change
> the way 'print' works.

For the record I spend a part of the summer teaching GP2C to handle
"automatic concatenation" correctly (the so-called newparser).
Now it is supposed to work. I really believe this syntax is awkwar and
using commas is better, but too many gp2c users were unhappy to need
to fix theirs scripts to use GP2C.

There is no reason to skip the side effect. In fact the grammar in 2.2.4
is no more ambiguous. It works by reading tokens until it is no more
possible to build a larger expression, and concatening as string the 
resutling expressions.

So
print(b=a"+"a)
is read as expr(b=a)expr("+")expr(a) ans so is equivalent to
print(b=a,"+",a)

Cheers,
Bill