Objects in this language are defined as type
s. They have properties with
default values that can be overridden in the constructor literal syntax.
There are no methods, but instead have conditional message handlers. The handlers are scoped by the state of the internal properties. Depending on the state the value is in, different messages can be responded to in different ways.
Also values can actively delete themselves causing all references to them to be deleted and replaces with a null type that doesn't respond to anything. (thus freeing up memory)
type Ball:
life = 100
x = 0
y = 0
when life > 0:
on draw(canvas):
canvas.circle(x, y, 10, :red)
on update(ms):
life -= 1
x += ms
else:
delete
type Canvas:
on circle(x,y,r,c):
...
canvas = <Canvas>
ball = <Ball x=64 y=64>
ball.update(10)
ball.draw(canvas)
@cadorn, what do you mean object property manipulation?
This language is still in early design, not even sure I'll make it.
But writing a compiler that emits plain JS shouldn't be too hard.