Issue 7513: sub evaluations (in sequence bodyEvals) have different environment. (ocl2-rtf) Source: OpenModeling (Mr. Jos Warmer, jos.warmer(at)openmodeling.nl) Nature: Uncategorized Issue Severity: Summary: 5. -- [3] All sub evaluations (in the sequence bodyEvals) have a different -- environment. The environment is the same environment as the one from the -- previous bodyEval, where the iterator variable or variables are bound to the -- subsequent elements of the source. context LoopExpEval inv: let SS: Integer = source.value->size() in if iterators->size() = 1 then Sequence{2..SS}->forAll( i: Integer | bodyEvals->at(i).environment = bodyEvals->at(i-1).environment ->replace( NameValueBinding( iterators->at(1).varName, source.value->asSequence()->at(i) ))) else -- iterators->size() = 2 Sequence{2..SS*SS}->forAll( i: Integer | bodyEvals->at(i).environment = bodyEvals->at(i-1).environment ->replace( NameValueBinding( iterators->at(1).varName, source->asSequence()->at(i.div(SS) + 1) )) ->replace( NameValueBinding( iterators->at(2).varName, source.value->asSequence()->at(i.mod(SS)) )) ) endif ==> two closing brackets before ’endif’ should be removed Resolution: yes Revised Text: In 10.3.2.18 LoopExpEval replace source.value->asSequence()->at(i.mod(SS)) )) ) )) by source.value->asSequence()->at(i.mod(SS)) )) ) Actions taken: June 10, 2004: received issue December 23, 2013: closed issue Discussion: End of Annotations:===== s is issue # 7512 sub evaluations (in the sequence bodyEvals) 4. -- [2] All sub evaluations (in the sequence bodyEvals) have a different -- environment. The first sub evaluation will start with an environment in which -- all iterator variables are bound to the first element of the source. Note that -- this is an arbitrary choice, one could easily well start with the last element -- of the source, or any other combination. context LoopExpEval inv: let bindings: Sequence( NameValueBindings ) = iterators->collect( i | NameValueBinding( i.varName, source->asSequence()->first() ) in bodyEvals->at(1).environment = self.environment->addAll( bindings ) ==> missing closing bracket before .in.