[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [qvto-dev] QVT13-48 allInstances() needs clarification
|
On 06/10/2015 12:45, Sergey Boyko wrote:
On one hand allInstances() comes from OCL world and its'
'side-effect-free' behavior should be preserved
Hi Sergey
That one exactly is Ed's argument from the very beginning, and that's
the statement I'm questioning. Why should be preserved ?
OCL Collections are immutable. Following the same reasoning, Lists and
Dicts should not have ever been introduced in QVTo, at least as a new
kind of Collection.
IMHO, the correct approach of thinking is the following: OCL is a
side-effects free, and because of that you can say that "allInstances
returns the same result on every call". QVT is not not side-effects
free, therefore you can't rely on the same conclusion for allInstances.
That's all, but I don't see anything wrong with that.
My argument is that In a new language context, semantics can be changed
if needed. Nothing is wrong with allInstances in QVT, the semantics of
allInstances doesn't even have to be changed, i.e give all the objects
instance of a particular type involved in a transformation. No problem
with that. The only undesirable language property we lose is that we
can't ensure that calling allInstances in a QVT context will always
return the same results. It's a pity losing this kind of nice
properties, but it one of the prices we have to pay by working with a
side-effect language.... but is there anything wrong with that?, because
I can't see the problem yet...
Regards,
Adolfo.