Listing methods

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

Listing methods

Gemstone/S mailing list
hi all,

I would like to know what is the best way to list all methods of a class, a method like: Class>>#allMethods so I can get apply some #asArray on it

Thank you,

Pierre

_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Listing methods

Gemstone/S mailing list
<className> selectors



------------------------------------------------------------------------
Bill Erickson
GemTalk Systems Engineering
15220 NW Greenbrier Parkway #240, Beaverton OR 97006
------------------------------------------------------------------------

On Tue, Feb 24, 2015 at 7:15 AM, Pierre CHANSON via GemStone-Smalltalk <[hidden email]> wrote:
hi all,

I would like to know what is the best way to list all methods of a class, a method like: Class>>#allMethods so I can get apply some #asArray on it

Thank you,

Pierre

_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk



_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Listing methods

Gemstone/S mailing list
Thank you very much Reno and Bill !

actually for me SystemRepository class or Repository don't reconize # _methodDict. Maybe due to my version of GemStone ? (GemStone64Bit3.2.1-x86_64.Linux)

I was using something like:
(Repository instVarNamed: 'methDicts') asArray.
But was not exactly nice nor what I needed because it give me some GsNMethod.

the method #selectors works just fine :)

Thanks,

Pierre


2015-02-24 12:32 GMT-03:00 Bill Erickson <[hidden email]>:
<className> selectors



------------------------------------------------------------------------
Bill Erickson
GemTalk Systems Engineering
15220 NW Greenbrier Parkway #240, Beaverton OR 97006
------------------------------------------------------------------------

On Tue, Feb 24, 2015 at 7:15 AM, Pierre CHANSON via GemStone-Smalltalk <[hidden email]> wrote:
hi all,

I would like to know what is the best way to list all methods of a class, a method like: Class>>#allMethods so I can get apply some #asArray on it

Thank you,

Pierre

_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk




_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Listing methods

Gemstone/S mailing list
Actually an interesting thing with GsNMethods would be to access the source code from here somehow...

Pierre

2015-02-24 14:15 GMT-03:00 Pierre CHANSON <[hidden email]>:
Thank you very much Reno and Bill !

actually for me SystemRepository class or Repository don't reconize # _methodDict. Maybe due to my version of GemStone ? (GemStone64Bit3.2.1-x86_64.Linux)

I was using something like:
(Repository instVarNamed: 'methDicts') asArray.
But was not exactly nice nor what I needed because it give me some GsNMethod.

the method #selectors works just fine :)

Thanks,

Pierre


2015-02-24 12:32 GMT-03:00 Bill Erickson <[hidden email]>:

<className> selectors



------------------------------------------------------------------------
Bill Erickson
GemTalk Systems Engineering
15220 NW Greenbrier Parkway #240, Beaverton OR 97006
------------------------------------------------------------------------

On Tue, Feb 24, 2015 at 7:15 AM, Pierre CHANSON via GemStone-Smalltalk <[hidden email]> wrote:
hi all,

I would like to know what is the best way to list all methods of a class, a method like: Class>>#allMethods so I can get apply some #asArray on it

Thank you,

Pierre

_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk





_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Listing methods

Gemstone/S mailing list
Alright <class> sourceCodeAt: <aSelector found with #selectors>. Got it :) Not direct but efficient

2015-02-24 14:40 GMT-03:00 Pierre CHANSON <[hidden email]>:
Actually an interesting thing with GsNMethods would be to access the source code from here somehow...

Pierre

2015-02-24 14:15 GMT-03:00 Pierre CHANSON <[hidden email]>:

Thank you very much Reno and Bill !

actually for me SystemRepository class or Repository don't reconize # _methodDict. Maybe due to my version of GemStone ? (GemStone64Bit3.2.1-x86_64.Linux)

I was using something like:
(Repository instVarNamed: 'methDicts') asArray.
But was not exactly nice nor what I needed because it give me some GsNMethod.

the method #selectors works just fine :)

Thanks,

Pierre


2015-02-24 12:32 GMT-03:00 Bill Erickson <[hidden email]>:

<className> selectors



------------------------------------------------------------------------
Bill Erickson
GemTalk Systems Engineering
15220 NW Greenbrier Parkway #240, Beaverton OR 97006
------------------------------------------------------------------------

On Tue, Feb 24, 2015 at 7:15 AM, Pierre CHANSON via GemStone-Smalltalk <[hidden email]> wrote:
hi all,

I would like to know what is the best way to list all methods of a class, a method like: Class>>#allMethods so I can get apply some #asArray on it

Thank you,

Pierre

_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk






_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Listing methods

Richard Sargent
Administrator
In reply to this post by Gemstone/S mailing list
Pierre wrote
I would like to know what is the best way to list all methods of a class, a
method like: Class>>#allMethods so I can get apply some #asArray on it
Do you want the names of the methods or the compiled methods themselves? What is it you want to do with them?
Reply | Threaded
Open this post in threaded view
|

Re: Listing methods

Richard Sargent
Administrator
In reply to this post by Gemstone/S mailing list
Pierre wrote
Actually an interesting thing with GsNMethods would be to access the source
code from here somehow...
Well, there is GsNMethod>>#sourceString.
Reply | Threaded
Open this post in threaded view
|

Re: Listing methods

Gemstone/S mailing list
The idea was to look for a method of a class, known it's name, then see the source code.

So my primary idea was to go to the class, then list the compiled methods form here, select the one with the good name and then get the source code. :)

The problem was I did not have the name of the methods from the GsNMethods listed (Or maybe I missed a "name" instance variable)

Know I realized that the good solution was #sourceCodeAt:

Pierre

2015-02-24 17:16 GMT-03:00 Richard Sargent via GemStone-Smalltalk <[hidden email]>:
Pierre wrote
> Actually an interesting thing with GsNMethods would be to access the
> source
> code from here somehow...

Well, there is GsNMethod>>#sourceString.




--
View this message in context: http://forum.world.st/Listing-methods-tp4807299p4807393.html
Sent from the Gemstone/S mailing list archive at Nabble.com.
_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk


_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk