Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-03-16
04:20 • Deleted ticket [916871ffff]: catch docs should define `exceptional returns&#39... artifact: fa984dc475 user: eriklns
2004-03-15
20:47 • New ticket [916871ffff]. artifact: 2174be3c9d user: eriklns

[catch] docs should define `exceptional returns'

Deleted916871ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2004-03-15 20:47:12
The manpage for [catch] mentions as the cases that are
trapped:
- errors
- exceptional returns

About the latter, it leaves for the user to refer to
"tcl.h" to look up the complete list of return codes
that are trapped, while explaining some of them later
in the text (break, continue).

This leaves much room for misinterpretation.
I think it is better to:
- adequatel define the term `exceptional return'
- explicitly mention all the Tcl commands and
corresponding return codes that are trapped

A special cases of misunderstanding is the "normal
return" which in this context is considered an
"exceptional return" because it appears to be trapped:

proc catchReturn {} {
    if {[catch {
        return
    } err]} {
    puts $err
    }
}
catchReturn


Sincerely,

Erik Leunissen
eriklns Deleted ticket [916871ffff]. [History diff]2004-03-16 04:20:08
Log in (anonymous is fine) to add a comment.