Hey guys,
Just in case this can be useful to others, here's a 100% transparent
implementation of a proxy in Amber. It removed inherited methods on each
instance at initialization:
Proxy >> initialize
super initialize.
self inheritedSelectors do: [ :each | <self[each._asSelector()] = undefined> ]
Proxy >> inheritedSelectors
| selectors methods |
methods := self basicAt: 'inheritedMethods'.
selectors := #().
<for(var selector in methods) {selectors.push(selector)}>.
^ selectors
reject: [ :each | self class methodDictionary keys includes: each ].
Proxy >> doesNotUnderstand: aMessage
"Forward message sends here"
^ aMessage sendTo: anObject
Cheers!
Nico
--
Nicolas Petton
http://nicolas-petton.fr