[Gridflow-dev] [#expr] (was: jMax)

Jonathan Wilkes jancsika at yahoo.com
Fri Sep 24 16:45:11 EDT 2010



--- On Fri, 9/24/10, Mathieu Bouchard <matju at artengine.ca> wrote:

> From: Mathieu Bouchard <matju at artengine.ca>
> Subject: Re: [#expr] (was: jMax)
> To: "Jonathan Wilkes" <jancsika at yahoo.com>
> Cc: pd-list at iem.at, gridflow-dev at artengine.ca
> Date: Friday, September 24, 2010, 10:11 PM
> On Fri, 24 Sep 2010, Jonathan Wilkes
> wrote:
> 
> > That's a really good point, and I think you're right
> that it is this kind of "if" behavior really belongs in a
> different object.
> 
> btw i just added sin() cos() exp() log() tanh() sqrt()
> abs() rand().
> 
> Now I would like to know, when you write something like
> [expr a*b+c], how would you make those variables local. For
> example, if you have :
> 
>   [v $0-a]
>   [v $0-b]
>   [v $0-c]
> 
> How do you write an [expr] formula that uses those three
> variables. Now, if there's no way to support that in [expr],
> how would I add support for that in [#expr] ?

It's a little ugly:

[expr _$0_a]

[v _$0_a]

[expr _$0.a] seems to fail, and of course [expr _$0-a] won't do 
what you want.

But my hack seems only to work because $0 is guaranteed to 
exist.  With $1 or greater if you're not inside 
an abstraction with that arg, [v _$1_a] will create but [expr 
_$1_a] will not.  

-Jonathan

> 
> If they are going to work only with global variables, i'm
> not really interested in those, because I can't use [expr
> a*b+c] in an abstraction without causing a conflict of
> variables when instantiated more than once (and perhaps even
> when instantiated just once !).
> 
> 
> _______________________________________________________________________
> | Mathieu Bouchard ------------------------------ Villeray,
> Montréal, QC


      



More information about the Gridflow-dev mailing list