Underpinnings of Method Wrapping

T

T. Onoma

Its important that we clearly seperate the issue of "surface" syntax from the
underlying machanics of method wrapping. We can pretty much use any notation
that is decided upon. But then how does it work underneath the hood?

My proposal, irregardless of the (IMHO elegant) syntax it presents, has a
solid and tried implementation behind it. This fact may easily go overlooked.
So i just want to take a second and specify that here.

It works simply by using a natural extension to singletons. In fact, I spent
the day hacking the Ruby source code to implement "meta-singletons".
Basically, it allows you to define singletons on singletons (on singletons)
etc. This implements a stackable wrap. And it optimizes wraps by only
creating a new metaclass layer when necessary. (see Pickaxe p245 end of
Object-Specific Classes) That's all there was to it.

If we extend this facility to handle pre and post and give singletons a class
literal syntax, plus some lower level methods for manuipulating the
stack....well, that should do it.

Thoughts?

-t0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,816
Members
47,361
Latest member
RogerDuabe

Latest Threads

Top