[Pharo-dev] Returning the source of a class as a string
thierry.goubier at gmail.com
Fri Jul 25 17:28:55 EDT 2014
Le 25/07/2014 23:15, Marcus Denker a écrit :
> On 25 Jul 2014, at 21:51, Thierry Goubier <thierry.goubier at gmail.com> wrote:
>> Le 25/07/2014 21:42, kilon alios a écrit :
>>> ok we are getting somewhere, the problem is that if I do
>>> (SomeClass compiledMethodAt: #nameOfMethod it will look only in the instance side for method, how I look also for class methods ? Also how I can return source of class ? to be specific I need the names of instance variables, class variables and class instance variables .
>> For the class method:
>> SomeClass class compiledMethodAt: #nameOfClassMethod
>> For the instance variable, etc... SomeClass definition will give you that. But it's a bit tricky to parse; for example, if you want a reification (instance variable name is recognized as instance variable name in the ast), I have some code which does: parse, rewrite and reparse on a class definition (for the smart suggestion thing).
> Yes, we need that…
> there is code on the issue tracker, too:
Yes. What about the class definition format change described by Camillo?
More information about the Pharo-dev