fun question and answer

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

fun question and answer

Stéphane Ducasse
Hi guys

I want to print the name of a classVar and its value.
So I tried something like

Processor class classVarNames
        do: [:each | Transcript show: each ; show: each value ; cr]


the solution....

Processor class classVarNames
        do: [:each | Transcript
                                show: each ;
                                show: (Compiler evaluate: each for: Processor logged: false)  
printString ;
                                cr]


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: fun question and answer

Lukas Renggli
What about inspecting/printing the following expression?

     Processor class classPool

On Mon, Apr 27, 2009 at 6:29 PM, Stéphane Ducasse
<[hidden email]> wrote:

> Hi guys
>
> I want to print the name of a classVar and its value.
> So I tried something like
>
> Processor class classVarNames
>        do: [:each | Transcript show: each ; show: each value ; cr]
>
>
> the solution....
>
> Processor class classVarNames
>        do: [:each | Transcript
>                                show: each ;
>                                show: (Compiler evaluate: each for: Processor logged: false)
> printString ;
>                                cr]
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: fun question and answer

Stéphane Ducasse
yes much better :)

Stef

On Apr 27, 2009, at 6:37 PM, Lukas Renggli wrote:

> What about inspecting/printing the following expression?
>
>     Processor class classPool
>
> On Mon, Apr 27, 2009 at 6:29 PM, Stéphane Ducasse
> <[hidden email]> wrote:
>> Hi guys
>>
>> I want to print the name of a classVar and its value.
>> So I tried something like
>>
>> Processor class classVarNames
>>        do: [:each | Transcript show: each ; show: each value ; cr]
>>
>>
>> the solution....
>>
>> Processor class classVarNames
>>        do: [:each | Transcript
>>                                show: each ;
>>                                show: (Compiler evaluate: each for:  
>> Processor logged: false)
>> printString ;
>>                                cr]
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project