[cad-linux-dev] yet a little more...

  • From: "cr88192" <cr88192@xxxxxxxxxxx>
  • To: <cad-linux-dev@xxxxxxxxxxxxx>
  • Date: Tue, 9 Dec 2003 23:35:04 -0800

I have started writing the interpreter now (some a few hours ago, getting
distracted by other crap...).

well, anyways. I have varied the design a bit while implementing:
for right now I will will not implement let (though this will be useful
later);
I have also decided for now not to include lambda.

instead of lambda for now I decided to go with "blocks". unlike a lambda a
block does not have explicit arguments, and the named properties are bound
on apply (giving it semantics similar to lambda and let). with these
semantics blocks are largely a more general mechanism, and for now blocks
would simplify implementation.

I also added define (which binds things in the current environment,
presently only allowed at top level).
other things are being adjusted as needed.

(define foo (block (+ x y)))
;defines foo as a block. x and y are expected to be filled in on apply.

(foo x: 3 y: 4)
;binds x and y to 3 and 4, then evaluates body with them bound.
;the result is 7.

the interpreter is starting out a little ugly, but this is not too major of
a problem.
for now it tries to evaluate "whatever it can", leaving forms with unbound
variables and such unevaluated.


ultimately I will get to the geometry part...

I need to sleep.
all for now.


Other related posts:

  • » [cad-linux-dev] yet a little more...