[chuck] (no subject)

Ge Wang gewang at CS.Princeton.EDU
Thu Feb 17 17:36:31 EST 2005


>> Doing
>>
>> a/b::second => dur q;
>>
>> gives a parse error however.
>>
>
> Have you tried (a/b)::second => dur q; ? I've noticed that the parser 
> is VERY nitpicking on arithmetic before the ::....

This is an issue with operator precedence - currently the :: is 
resolved before arithmetic, to enable things like:

     now + 2::second => time later;

and

    10::second / 5::second => float ratio;

the problem is

     4/2::second

will result in a type error - this expression is parsed as (4) / 
(2::second)...

(4/2)::second is currently the way to evaluate 4/2 first before 
::second, as Mikael noted.

We have yet to find a good balance for this part of the grammar...

Best,
Ge!



More information about the chuck mailing list