Re: [eclipse-users] Conditional jump out of loops

From: Kish Shen <kish.shen_at_crosscoreop.com>
Date: Wed, 24 Jan 2007 21:43:37 +0000
On Wednesday 24 January 2007 20:33, Kish Shen wrote:
> On Wednesday 24 January 2007 20:02, Kish Shen wrote:
> > 
> > fromto(_,End,End, end) do .....
> > 

Sorry again, I should have thought more about this. The above will always succeed, as end 
will always unify with End at the end of the first iteration.

The fromto should be in the form:

fromto(continue,_,LoopState, end) 

and for continuing the loop, unify LoopState with continue, and for termination, unify LoopState
with end, e.g.:

(fromto(continue, _,LoopState, end) do
   ....
  (continue(...) -> LoopState = continue ; LoopState = end)
)

where continue(...) is a test to see if you want to continue.

Cheers,

Kish
Received on Wed Jan 24 2007 - 21:42:10 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:57 CET