Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-24 Thread Tudor Girba
Hi,

Indeed, DeepTraverser is the project to look at. I started it from the code of 
Mariano, and then Stefan Rechhart reimplemented it from scratch to make it very 
fast (e.g. traversing subclasses of a class is only 10% slower than the hard 
coded withAllSubclassesDo:) and to make it work like a stream. It's really 
beautiful.

Cheers,
Doru

--
www.tudorgirba.com

"Every thing has its own flow"

> On 22 Dec 2015, at 14:06, Mariano Martinez Peck  wrote:
> 
> Denis,
> 
> The DeepTraverser was a little easy hack I shared years ago to Tudor Girba 
> which he then (improved it?) put it in Moose.
> While it works is still very limited. You can give it a try. And if not, 
> please spend some time checking the graph traverser we have in Fuel. I 
> suspect it could be easily adapted for custom code, but I am not sure ;)
> 
> Basically, check FLAnalysis >> run, which has a stack and starts the trace 
> via #mapAndTrace: 
> 
> Cheers,
> 
>> On Tue, Dec 22, 2015 at 6:20 AM, Denis Kudriashov  
>> wrote:
>> I found this: http://smalltalkhub.com/#!/~Moose/DeepTraverser
>> 
>> 2015-12-22 10:05 GMT+01:00 Marcus Denker :
>>> 
>>> > On 22 Dec 2015, at 09:46, Denis Kudriashov  wrote:
>>> >
>>> > Hello.
>>> >
>>> > Do we have way to traverse object graph?
>>> >
>>> > I want stream which iterate object graph through instance variables with 
>>> > knowledge about path at every step.
>>> >
>>> > Maybe Fuel has classes for this ?
>>> >
>>> 
>>> yes, I think so.. there is #fuelAccept:, but I am not sure how general it 
>>> is.
>>> 
>>> I remember that Doru did some object graph iteration experiments, too?
>>> (I can’t find it).
>>> 
>>> But I think we should actually add a general “object graph iterator” to the 
>>> reflective
>>> features of the language. It seems very useful to have, and for sure Fuel 
>>> could just
>>> use it.
>>> 
>>> Marcus
> 
> 
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com


Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Mariano Martinez Peck
Denis,

The DeepTraverser was a little easy hack I shared years ago to Tudor Girba
which he then (improved it?) put it in Moose.
While it works is still very limited. You can give it a try. And if not,
please spend some time checking the graph traverser we have in Fuel. I
suspect it could be easily adapted for custom code, but I am not sure ;)

Basically, check FLAnalysis >> run, which has a stack and starts the trace
via #mapAndTrace:

Cheers,

On Tue, Dec 22, 2015 at 6:20 AM, Denis Kudriashov 
wrote:

> I found this: http://smalltalkhub.com/#!/~Moose/DeepTraverser
>
> 2015-12-22 10:05 GMT+01:00 Marcus Denker :
>
>>
>> > On 22 Dec 2015, at 09:46, Denis Kudriashov 
>> wrote:
>> >
>> > Hello.
>> >
>> > Do we have way to traverse object graph?
>> >
>> > I want stream which iterate object graph through instance variables
>> with knowledge about path at every step.
>> >
>> > Maybe Fuel has classes for this ?
>> >
>>
>> yes, I think so.. there is #fuelAccept:, but I am not sure how general it
>> is.
>>
>> I remember that Doru did some object graph iteration experiments, too?
>> (I can’t find it).
>>
>> But I think we should actually add a general “object graph iterator” to
>> the reflective
>> features of the language. It seems very useful to have, and for sure Fuel
>> could just
>> use it.
>>
>> Marcus
>>
>>
>>
>>
>>
>


-- 
Mariano
http://marianopeck.wordpress.com


Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Denis Kudriashov
I found this: http://smalltalkhub.com/#!/~Moose/DeepTraverser

2015-12-22 10:05 GMT+01:00 Marcus Denker :

>
> > On 22 Dec 2015, at 09:46, Denis Kudriashov  wrote:
> >
> > Hello.
> >
> > Do we have way to traverse object graph?
> >
> > I want stream which iterate object graph through instance variables with
> knowledge about path at every step.
> >
> > Maybe Fuel has classes for this ?
> >
>
> yes, I think so.. there is #fuelAccept:, but I am not sure how general it
> is.
>
> I remember that Doru did some object graph iteration experiments, too?
> (I can’t find it).
>
> But I think we should actually add a general “object graph iterator” to
> the reflective
> features of the language. It seems very useful to have, and for sure Fuel
> could just
> use it.
>
> Marcus
>
>
>
>
>


Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Robert Withers
I'm sorry, this is with Fuel loaded. These are extensions to Fuel 
serialization and materialization.



b, robert


On 12/22/2015 03:55 AM, Robert Withers wrote:
I managed to get per object substitution callbacks working in 
Mushroom. Please take a look in http://www.squeaksource.com/Mushroom 
and load Mushr00m-Pharo on top of MushrOOm (after installing 
Cryptography and SecureSession from 
http://www.squeaksource.com/Cryptography).


Then look at the classes in the Utility category.

HTH,

Robert



On 12/22/2015 03:46 AM, Denis Kudriashov wrote:

Hello.

Do we have way to traverse object graph?

I want stream which iterate object graph through instance variables 
with knowledge about path at every step.


Maybe Fuel has classes for this ?

Best regards,
Denis




--
. ..  ...   ^,^robert
Go Panthers!




Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Marcus Denker

> On 22 Dec 2015, at 09:46, Denis Kudriashov  wrote:
> 
> Hello.
> 
> Do we have way to traverse object graph?
> 
> I want stream which iterate object graph through instance variables with 
> knowledge about path at every step.
> 
> Maybe Fuel has classes for this ?
> 

yes, I think so.. there is #fuelAccept:, but I am not sure how general it is.

I remember that Doru did some object graph iteration experiments, too?
(I can’t find it).

But I think we should actually add a general “object graph iterator” to the 
reflective 
features of the language. It seems very useful to have, and for sure Fuel could 
just
use it.

Marcus






Re: [Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Robert Withers
I managed to get per object substitution callbacks working in Mushroom. 
Please take a look in http://www.squeaksource.com/Mushroom and load 
Mushr00m-Pharo on top of MushrOOm (after installing Cryptography and 
SecureSession from http://www.squeaksource.com/Cryptography).


Then look at the classes in the Utility category.

HTH,

Robert



On 12/22/2015 03:46 AM, Denis Kudriashov wrote:

Hello.

Do we have way to traverse object graph?

I want stream which iterate object graph through instance variables 
with knowledge about path at every step.


Maybe Fuel has classes for this ?

Best regards,
Denis


--
. ..  ...   ^,^robert
Go Panthers!




[Pharo-dev] Object graph stream/visitor implementation?

2015-12-22 Thread Denis Kudriashov
Hello.

Do we have way to traverse object graph?

I want stream which iterate object graph through instance variables with
knowledge about path at every step.

Maybe Fuel has classes for this ?

Best regards,
Denis