Generic operators
Bwain| No Comments »I was able to create seperate grammars for functions, and shaders. So I can now re-use the function grammar for other things.
Next step: Create generic operators. Kinda like .otls. A good place to start is the Ultrafractal merge, since I’ll be using this to combine layers. Found this link describing the different algorithms used. I also want to create a ’switch’ statement for the shading language. Having a chain of if-then-else statements will be kind of a drag.
I’ve come up against the next roadblock. I want to be able to create meta types, which are types parameterized by other types. Kind of like class templates that take other types as arguments. It would be easy to extend the grammar to handle this. The Array class, (and any container class really) would be good candidates for this.
The problem is spa::Type. Currently, its a bit field, which really is overkill. All it should really be is an unsigned integer. The bitfield should be a seperate class. The functionality for the bitfield only exists in the symbol tables for specifying multiple types, and that’s pretty much it. Changing spa::Type to an ‘int’, and creating a seperate bitfield will require breaking a lot.
But its necessary. Once that’s done, we can do
Array
I suppose you can debate about which arguments should be meta-types, and which arguments should be constructor arguments. With a scripting language, it doesn’t matter since everything is an object. But I really like the template syntax.
Another thing is doing a proper (recursive) array value type. I want to be able to do this:
Array stuff = { { “one”, “two”, “three” }, { 10 11 12 }, { Blue Red Green } } ;
So some arrays will be typesafe, but some wont…. This might require for variables to be able to change types depending on their assignment. That could be really cool, or confusing. The current Array implementation can handle all of these cases, which is good.


