Code: Select all
rule Fred { SomeRule { x 0.1 }}
rule Fred { SomeRule { x 0.2 }}
rule Fred { SomeRule { x 0.3 }}
...
rule Fred { SomeRule { x 0.9 }}
rule Fred { SomeRule { x 1.0 }}
Code: Select all
rule Fred2 { SomeRule { x [0.1 10 0.1] }}
Another, more flexible approach could be a weighted-array:
Code: Select all
rule Fred3{ SomeRule{ x {0.1 1, 0.2 2, 0.8 8, 0.9, 1.0} } }
-------------------
"And now for something, completely different."
There has already been talk of passing variables to child objects, and this is something related: Local attribute manipulation
This is just a "grief you're lazy Trav" ease-of-development thing for quicker development of CFDG files. It's not entirely uncommon to see things like:
Code: Select all
SomeRule { x 15 }
SomeRule { x 30 }
SomeRule { x 45 }
...
SomeRule { x 165 }
SomeRule { x 180 }
Code: Select all
x [ 15 ]
SomeRule{ /* x passed implicitly, = 15 */ }
x [ 15 ]
SomeRule{ /* x passed implicitly, = 30 */ }
x [ 15 ]
SomeRule{ /* x passed implicitly */ }
x [ 15 ]
SomeRule{ /* x passed implicitly */ }
x [ 15 ]
....
SomeRule{ /* x passed implicitly, = 165 */ }
x [ 15 ]
SomeRule{ /* x passed implicitly, = 180 */ }
//by now we've lost x, so reset to default by:
x []
-------------------
I don't know how useful or not these ideas are to others or how complex they are to implement, but I thought I'd throw these into the fray anyway.
Cheers!
-Trav