Closed francescoagati closed 13 years ago
Thanks for opening this issue.
By a macro, do you mean you would like something similar to (defclass FooBar ...) and (new FooBar)?
In that case, this wouldn't really be possible with macros since it's generating PHP code that the compiler does not currently support. OOP support in that sense would require compiler built-ins, which I may implement at some point in the future.
On the other hand, I've got a simple pure-Pharen implementation of multimethods right now that I'll push up sometime soon. If you have any suggestions, let me know!
you could a macro inline that permit of insert directly code php
for example:
(defmacro class name body )
Using inline, the above could probably work as a function instead of a macro.
I'm not really comfortable with inline, however. For example, inside a macro it would be difficult to figure out what exactly is being done. It could also encourage poor coding practices.
Implementing proper OOP support, without inline, wouldn't be difficult in itself, I just want to make sure I do it right the first time.
The beginnings of OOP support have been added. For more you can reference the oop documentation.
Should be nice create macro from oop ( classes, interfaces, instance creation).