Sunday, September 12, 2010

Boo Scripting Concept

From unit testing standpoint, to add various classes that are called automatically in a testing framework makes sense. It will keep your functionality separated, and can add more logic as is needed.
For people that wants to create a shape, like the lua gear, to define your class, sometimes to derive your class code, to write methods with fixed names, and so on, will add complexity. So the work that was done is that the user can write a body of code, that just have drawing primitives (that have for now the same callback methods as Lua did use) and I will automatically wrap in a class and add all needed dependencies to code to work.
So a script like:
Line(0, 0, 0, 100, 100, 0)
will become internally:
import BooCoreScript from BooCoreScript
internal class BodyBooScript(BooScript):
public def Do():
Line(0, 0, 0, 100, 100, 0);
Also, if the code wrapper will see that you will define your own functions and classes, it will not make automatically indent.
Like:
Line (... )
class Point
X as double
Y as double

This class will become visible and can be callable from the scripting code. So generated class body code will simplify how people can write scripts and will be similar with simplicity of Lua, But for advanced users, they can separate their logic using more complex structures as needed.

No comments: