On Tuesday, October 08, 2013 11:19:19 AM Claude Warren wrote:
> Seems unintuitive to me but I'll just document it that way.
> 
> I think that it should not add the new statement to the model unless the
> old statement was in the model.  

Well, perhaps. But what we've got has a definite defined behaviour;
I don't see that changing gets us a significant advantage.

> Off the top of my head I can't think of a
> good reason why a developer would want to do this 

It allows them to use changeObject to insert statements into the
model without worrying about whether the original statement happened
to be contained in the model or not.

> but I don't like that
> except for the difference in the object, the state of the new object does
> not match the state of the old object.  My gut feel is that only the object
> should change.

I think it's too late to change the behaviour of changeObject().
 
> On Tue, Oct 8, 2013 at 10:14 AM, Chris Dollin
> <chris.dol...@epimorphics.com>wrote:
> 
> > On Tuesday, October 08, 2013 09:56:26 AM Claude Warren wrote:
> > > So just to be clear.
> > >
> > > If a Statment S has the conditions:
> > > S.getModel() = M
> > > M.contains(S) = F
> > >
> > > and we call
> > > S2 = S.changeLiteralObject( o2 );
> > >
> > > we expect:
> > >
> > > S2.getModel() = M
> > > M.contains(S2) = T
> >
> > Yes.
> >
> > > So changing the object of a statement has the side effect
> >
> > It's not really a side effect. It's the effect. That's what changeObject is
> > for.
> >
> > > of putting the
> > > new statement in the model even if the original statement was not in the
> > > model.
> >
> > Yes.
> >
> > The motivating activity for changeObject is "change the object of some
> > statement S from model M". "Changing the object" is done by removing
> > the old statement and adding the new one.  That this works even when
> > S wasn't in M (but just has it as its target model) is a happy accident.
> >
> > Chris
> >
> > --
> > RIP Diana Wynne Jones, 1934 - 2011.
> >
> > Epimorphics Ltd, http://www.epimorphics.com
> > Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
> > 6PT
> > Epimorphics Ltd. is a limited company registered in England (number
> > 7016688)
> >
> >
> 
> 
> 
-- 
"You're down as expendable. You don't get a weapon."    /Dark Lord of Derkholm/

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)

Reply via email to