[Gridflow-dev] expr problem with '**'

Mathieu Bouchard matju at artengine.ca
Tue Nov 8 17:06:13 EST 2011

Le 2011-11-02 à 16:36:00, Ricardo Fabbri a écrit :

> I'd like to report that #expr is mostly for me,

mostly _working_ for you ?

> but it doesn't recognize the '**' operator. From the #-test.pd :
> [#expr fact($f1)**2]: unknown operator '**'

Not all things written in tests/*.pd work. The big pile of stuff in 
#expr-test.pd should all work when you click the bang, but the rest of the 
tests aren't categorised, labelled or documented. Ideally, every 
automatable test would look like it is in #expr-test.pd. In the meanwhile, 
you have to ignore that [#expr] which is not even in the right test-file 
and is about a feature that is not implemented.

$f1**$f2 is to be written pow($f1,$f2) instead. The former is the syntax 
used in Ruby/Python/Pascal/Gnuplot/etc. The latter is the syntax used in 
[expr] and in C. I might add support for **, but it's not necessary right 
now, and it's trickier because it's an exception because of different 
parsing. It's a right-to-left association thing : a**b**c must parse as 
a**(b**c) and I didn't want to have to think about it at this point.

BTW, I just made [#expr] about 12 times faster on Sunday night. Now it's 
almost as fast as [expr].

| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC

More information about the Gridflow-dev mailing list