Anthony Borla wrote:

Greetings,

Just playing around with loops, and was wondering how to use loop features
like 'break' and 'continue'. The documentation:

   http://www.mozart-oz.org/documentation/loop/index.html

mentions and briefly describes such items, but doesn't appear to include any
code examples.

Their use appears fairly straightforward [i.e. invoke the feature-bound
routine from within the loop body], but I'm not at all sure where the
'feature declaration' [?] should be placed. A short code example or two on
these and other loop feature use would be very much appreciated.

Cheers,

Anthony Borla


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users
All features and generator are to be placed between "for" and "do"
Exemple:

for X in L break:B do
   {B}
end

For now, break and continue are implemented with exception, so don't use them in fail-proof try-catch blocks:

for X in L break:B do
   try
      {B}
   catch E then
      {Browse E}
   end
end

will not break and will browse some names.

Yves

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to