[squeak-dev] Clamato
Jason Rogers
jacaetevha at gmail.com
Sun Sep 6 03:12:56 UTC 2009
Have you tried that? It doesn't seem to work for me. Tried saving it
on Object, but it's not invoked as far as I can tell.
I am trying a different refactoring, like so:
- renderOn: html
...
self renderButtonFor: '+' on: html.
self renderButtonFor: '-' on: html.
...
- renderButtonFor: operation on: html
html button
with: operation;
onClick: [@counter := @counter perform: operation with: 1. self reload].
On Sat, Sep 5, 2009 at 12:43 PM, Avi Bryant<avi at dabbledb.com> wrote:
> On Sat, Sep 5, 2009 at 8:07 AM, Jason Rogers<jacaetevha at gmail.com> wrote:
>> A (hopefully) simple question. How would you implement #perform:with:
>> ? JS can handle the reflection (either via eval(...) or function
>> pointers).
>
> Here's an implementation as a primitive:
>
> - perform: aString with: anObject {
> return this[aString._mangleSelector()](anObject);
> }.
>
>
--
Jason Rogers
"I am crucified with Christ: nevertheless I live;
yet not I, but Christ liveth in me: and the life
which I now live in the flesh I live by the faith of
the Son of God, who loved me, and gave
himself for me."
Galatians 2:20
More information about the Squeak-dev
mailing list
|