Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: break/continue vs. try-always



On Jun 8, 10:50pm, Peter Stephenson wrote:
} Subject: Re: break/continue vs. try-always
}
} On Sun, 08 Jun 2014 14:01:46 -0700
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > } neater way to handle this would be to add an option to force break and
} > } continue to respect function scope.
} > 
} > The problem with that solution is that it propagates downward
} 
} This is why I pointed out you could do
}  
} setopt localoptions localloops
} () {
}    setopt nolocalloops # or emulation or whatever
}    # call user code
} }
} # localloops is restored on return here and used to cancel breaks /
} # contflag before resuming user code at this point.

Ah, you didn't have the "setopt nolocalloops" in the anonymous scope
the last time.   OK, this is fine, and it sets up up well in the event
that the austin-group decides to impose this semantics for Issue 8
(though it looks like they're going to make it unspecified instead).

-- 
Barton E. Schaefer



Messages sorted by: Reverse Date, Date, Thread, Author