4 ms·
Or: 1. Allow a factory for Class. 2. Make Method contain the full body contents as a list of statements, and give them a factory as well. Then it's a matter
by lallysingh 18y ago
Or:
1. Allow a factory for Class.
2. Make Method contain the full body contents as a list of statements, and give them a factory as well.
Then it's a matter of reasonable constructor syntax.
- orib 18y agoAnd a whole lot of "wait, what tree does this code map to again?" With lisp, there's no difficulty mapping: int main(int x) {foo()} to Method m = new Method(return:=new Type(int), args := new ArgList( new Arg(new Type(int), new Name("x"))), body := new Block( .... I'm sure you get the point.... The syntax tree is apparent from the syntax. (+ 1 2 (* 3 4)) Maps to: '(+ 1 2 (* 3 4))