getting selector and args in a generic way

Alan Lovejoy squeak-dev.sourcery at forum-mail.net
Tue Aug 23 08:49:11 UTC 2005


You can discover the selector of the currently executing method by
evaluating ‘thisContext methodSelector.’  The argument values can be
obtained by evaluating ‘(1 to: thisContext method numArgs) collect: [:i |
thisContext at: i].’

 

--Alan

 

  _____  

From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of Houssam
Fakih
Sent: Tuesday, August 23, 2005 1:07 AM
To: 'The general-purpose Squeak developers list'
Subject: getting selector and args in a generic way

 

Hi all,

 

How I get in the code of a method its name and its arguments?

 

If I have for instance the method 

my: arg1 method: arg2

 

I would like in the code of my:method: to get the selector (#my:method:) and
the args ({arg1.arg2}).

 

Thanks,

Houssam

 

____

"Le paradis touche les pieds des mères..."

>>> http://csl.ensm-douai.fr/fakih

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050823/4dde6f89/attachment.htm


More information about the Squeak-dev mailing list