Re: if else else



The thing fredderic had in mind
is imho a thing not realy connected to if or switch.

Essentially a method to _unwind_ some actions is required.

Now that is easily done using one of tcls main feature:
the dualism between data and code.

set unwind {}
if {![catch {set fd [ open $filename $op]} cerr]} {
append unwind "close $fd"
} else {
eval $unwind
exit
}
# continue with stacking operations
# eval $unwind on error

uwe

.



Relevant Pages

  • Re: if else else
    ... is imho a thing not realy connected to if or switch. ... Essentially a method to _unwind_ some actions is required. ... I do have to disagree here. ... Hence my preference for the term "follow-up" in this case. ...
    (comp.lang.tcl)
  • Re: HardBound and SoftBound
    ... If unwind sections are used, ... and to save/restore it just like any other callee-save registers/context. ... To my mind, that _IS_ a change in the existing ABI. ...
    (comp.arch)
  • Re: Bon Voyage Sue, Kevin and Jr. and everyone else leaving this weekend!
    ... the two days at sea are up front to unwind. ... Keep in mind that there Ft. Lauderdale is going to be a zoo, there are 8 ships in port on Sat. ...
    (rec.travel.cruises)