Shortcut for programmatically executing a class side method ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Shortcut for programmatically executing a class side method ?

Sven Van Caekenberghe-2
Hi,

Does there exist a shortcut for programmatically executing a class side method ?

For example,

String class>>#loremIpsum in: [ :method |
  method methodClass instanceSide perform: method selector ].

I was looking for a shortcut, like #eval, #execute, #value or something like that.

(String class>>#loremIpsum) eval.

Sven
Reply | Threaded
Open this post in threaded view
|

Re: Shortcut for programmatically executing a class side method ?

Nicolas Cellier
Normally, primitive 188 and 189 execute a method (the receiver is the method receiver).
Maybe search for senders...

Le dim. 13 janv. 2019 à 22:42, Sven Van Caekenberghe <[hidden email]> a écrit :
Hi,

Does there exist a shortcut for programmatically executing a class side method ?

For example,

String class>>#loremIpsum in: [ :method |
  method methodClass instanceSide perform: method selector ].

I was looking for a shortcut, like #eval, #execute, #value or something like that.

(String class>>#loremIpsum) eval.

Sven
Reply | Threaded
Open this post in threaded view
|

Re: Shortcut for programmatically executing a class side method ?

gcotelli
In reply to this post by Sven Van Caekenberghe-2
String perform: #method 

On Sun, Jan 13, 2019, 18:42 Sven Van Caekenberghe <[hidden email] wrote:
Hi,

Does there exist a shortcut for programmatically executing a class side method ?

For example,

String class>>#loremIpsum in: [ :method |
  method methodClass instanceSide perform: method selector ].

I was looking for a shortcut, like #eval, #execute, #value or something like that.

(String class>>#loremIpsum) eval.

Sven