Re: if else else



slebetman@xxxxxxxxx wrote:

Hmm.. why make it confusing and call it "else" why not "cleanup" or "finally". Other constructs can benefit from this:

if {test} {
something
} elseif {test} {
something
} else {
something else
} finally {
cleanup
}

switch -- foo {
pattern {
something
}
pattern {
something
}
default {
something else
}
finally {
cleanup
}
}


It would be clearer to me that the action would be taken only in case of a match if the "cleanup" or "finally" went before the "else" and "default".

Gerry
.



Relevant Pages

  • Re: if else else
    ... elseif ... ... clauses DID match) would be handy for such cleanup (or in this case, ...
    (comp.lang.tcl)
  • Re: Challenge: Loop in Common Lisp and in Java
    ... > When you have to do some clean up before exiting this might be a ... > good pattern. ... but in this case there was no cleanup necessary. ... cleanup code will be called even if an exception should arise, ...
    (comp.lang.lisp)
  • Re: if else else
    ... clauses DID match) would be handy for such cleanup (or in this case, ... } elseif { ... set ret [uplevel 1 $script] ...
    (comp.lang.tcl)
  • Re: if else else
    ... elseif ... ... clauses DID match) would be handy for such cleanup (or in this case, ... set cleanup ...
    (comp.lang.tcl)