On Jan 8, 2013, at 10:17 AM, Courtney Falk wrote:
> I'm attempting to do something similar with limited success.
>
> My approach is to treat the array as a terminal GPNode. Then I include two
> functions: one called "length" that takes the array as its one parameter and
> returns the length of the array, and a second called "get" that takes the
> array and an index value and returns the specific value at that index.
If you only have one array, why bother with a node representing it? Why not just have a function called (length) and another function called (get __index__), which is defined as, I dunno, mod(abs(floor __index__), length of array) ?
> Is there a motivation to use ERC instead of GPNode? Is there a benefit to
> be gained, or does it perhaps not matter?
Here's why I'd use an ERC. If you're plugging real-valued equations into __index_, you're going to be looking at nearly unreadable code. Anyway, you're going to need terminal constants one way or the other, which means ERCs. If you're going ERCs anyway, why not go the cleaner route and do ERCs for your variables?
Sean
|