deepCopying a mooseentity leads to an infinite loop

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

deepCopying a mooseentity leads to an infinite loop

Andre Hora
Hi guys

We wrote

testHasExactlySamePropertiesThan
    "p"

    | cp |
    "I should have the same entity than a copy of myself"
    self assert: (self nodeClass hasExactlySamePropertiesThan: self nodeClass deepCopy).
   
    cp := self nodeClass deepCopy.
    cp propertyNamed: #NOP ifAbsentPut: 12000. 
    "This property is described as a fame property but not existing on the copy
    so two entities should have different properties"
    self deny: (self nodeClass hasExactlySamePropertiesThan: cp).

and deepCopy loops on a FMValueLink


--
Andre Hora


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: deepCopying a mooseentity leads to an infinite loop

Andre Hora
We saw that veryDeepCopy is working.
Because deepCopy does not handle cycles.

On Fri, Jul 15, 2011 at 4:56 PM, Andre Hora <[hidden email]> wrote:
Hi guys

We wrote

testHasExactlySamePropertiesThan
    "p"

    | cp |
    "I should have the same entity than a copy of myself"
    self assert: (self nodeClass hasExactlySamePropertiesThan: self nodeClass deepCopy).
   
    cp := self nodeClass deepCopy.
    cp propertyNamed: #NOP ifAbsentPut: 12000. 
    "This property is described as a fame property but not existing on the copy
    so two entities should have different properties"
    self deny: (self nodeClass hasExactlySamePropertiesThan: cp).

and deepCopy loops on a FMValueLink


--
Andre Hora




--
Andre Hora


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: deepCopying a mooseentity leads to an infinite loop

Tudor Girba-2
Ok, this means there is no problem, right?

Doru


On 15 Jul 2011, at 17:32, Andre Hora wrote:

> We saw that veryDeepCopy is working.
> Because deepCopy does not handle cycles.
>
> On Fri, Jul 15, 2011 at 4:56 PM, Andre Hora <[hidden email]> wrote:
> Hi guys
>
> We wrote
>
> testHasExactlySamePropertiesThan
>     "p"
>
>     | cp |
>     "I should have the same entity than a copy of myself"
>     self assert: (self nodeClass hasExactlySamePropertiesThan: self nodeClass deepCopy).
>    
>     cp := self nodeClass deepCopy.
>     cp propertyNamed: #NOP ifAbsentPut: 12000.  
>     "This property is described as a fame property but not existing on the copy
>     so two entities should have different properties"
>     self deny: (self nodeClass hasExactlySamePropertiesThan: cp).
>
> and deepCopy loops on a FMValueLink
>
>
> --
> Andre Hora
>
>
>
>
> --
> Andre Hora
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"In a world where everything is moving ever faster,
one might have better chances to win by moving slower."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: deepCopying a mooseentity leads to an infinite loop

Stéphane Ducasse
yes fixed.

On Jul 15, 2011, at 7:20 PM, Tudor Girba wrote:

> Ok, this means there is no problem, right?
>
> Doru
>
>
> On 15 Jul 2011, at 17:32, Andre Hora wrote:
>
>> We saw that veryDeepCopy is working.
>> Because deepCopy does not handle cycles.
>>
>> On Fri, Jul 15, 2011 at 4:56 PM, Andre Hora <[hidden email]> wrote:
>> Hi guys
>>
>> We wrote
>>
>> testHasExactlySamePropertiesThan
>>    "p"
>>
>>    | cp |
>>    "I should have the same entity than a copy of myself"
>>    self assert: (self nodeClass hasExactlySamePropertiesThan: self nodeClass deepCopy).
>>
>>    cp := self nodeClass deepCopy.
>>    cp propertyNamed: #NOP ifAbsentPut: 12000.  
>>    "This property is described as a fame property but not existing on the copy
>>    so two entities should have different properties"
>>    self deny: (self nodeClass hasExactlySamePropertiesThan: cp).
>>
>> and deepCopy loops on a FMValueLink
>>
>>
>> --
>> Andre Hora
>>
>>
>>
>>
>> --
>> Andre Hora
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "In a world where everything is moving ever faster,
> one might have better chances to win by moving slower."
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev