Name: Anonymous 2009-03-26 22:23
I'm trying to make my own programming language with a syntax similar to lisp. Not actual lisp though. But right now I'm trying to work out how objects would work. Currently this is what I'm looking at:
C-style:
ball.x = ball.x + ball.vx;
Mine:
(set (ball "x") (+ (ball "x") (ball "vx")))
Basically an object really is just a function that returns a reference to the member with the name in the argument (i.e. x). This seems like it might be easy to implement, but there might just be a better syntax.
Any suggestions?
C-style:
ball.x = ball.x + ball.vx;
Mine:
(set (ball "x") (+ (ball "x") (ball "vx")))
Basically an object really is just a function that returns a reference to the member with the name in the argument (i.e. x). This seems like it might be easy to implement, but there might just be a better syntax.
Any suggestions?