2012/2/17 Timothy Baldridge <[email protected]>

> Basically I got to the point where I realized that if I had lisp
> macros, I could write RPython code way faster. Half of the structures
> in Clojure follow this pattern:
>
> class Foo(object):
>    def __init__(self, foo bar, baz):
>         self.foo = foo
>         self.bar = bar
>         self.baz = baz
>    def addBarBaz(self):
>         return bar + baz
>
> I could write that for that, or, in Clojure I could write myself a
> macro and just do:
>
> (deftype Foo [foo bar baz]
>      (addBarBaz[self] (+ bar baz)))
>

Remember that RPython works with imported modules, on classes and functions
in memory.
You are free to use exec() or eval() to build code.


-- 
Amaury Forgeot d'Arc
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to