On Wed, Sep 21, 2011 at 3:48 AM, Torsten Bergmann
<astares@gmx.de> wrote:
Hi Eliot,
at [1] you mentioned a port of MethodWrappers to Squeak 4.2.
Is there also a port for Pharo available or do you plan to
port it?
I was hoping someone with focus on Pharo would integrate the necessary compiler and kernel changes into Pharo. �The Squeak trunk packages are Compiler-eem.214 & Compiler-eem.215, and Kernel-619 to Kernel-eem.623. �I've attached the diffs. �Notionally file in�Compiler-213-214.st & Kernel-618-619.st, then file-in�Compiler-214-215.st &�Kernel-619-623.st. �These are generally useful, a) restoring the ability to create subclasses of CompiledMethod, and b) fixing various subtle copying-related state-sharing bugs with AdditionalMethodState (the objects that add additional state to compiled methods, pragmas, properties and "extra inst vars").
The MethodWrappers4.2 package should then just load. �It serves as a model for adding inst vars to CompiledMethod.
For those who dont know about MethodWrappers: look at [2]
Indeed. �Yes, there's an alternative implementation above objects-as-methods, but that implementation is far from complete. �It would be good to see he same kind of completeness. �e.g. with MethodWrappers you can write
| indent wrapper |
indent := 0.
wrapper := MwBlockMethodWrapper on: #benchFib inClass: Integer.
wrapper
beforeBlock: [:rcvr :args|
Transcript crtab: indent; print: rcvr; space; nextPutAll: #benchFib; flush.
indent := indent + 1];
afterBlock: [:rcvr :args| indent := indent - 1].
[wrapper install.
7 benchFib] ensure: [wrapper uninstall]
whereas there are few if any examples with the objects-as-methods AFAICS.
Thanks
Torsten
[1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2011-September/161567.html
[2] http://www.refactory.com/Software/MethodWrappers/
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zur�ck-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone