Artifacts Associated With Ticket c128108271
Ticket change [ee6ab741b1] (rid 147983) by adrianmedranocalvo on 2016-07-13 07:49:14:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
At the moment "trap" clauses in the "try" command must exactly match the -errorcode prefix. It would be useful being able to specify glob patterns for each of the -errorcode words. For example, given two TclOO subclasses implementing an interface (e.g. they share the superclass), we might want to prefix all -errorcodes with the class name similarly to how Tcl core prefixes all its errors with TCL. Trapping an error from either subclass can be done at the moment as follows: try { $a feed $x; } trap {::cow BADFOOD} {} - trap {::human BADFOOD} {} { $a drink; } This becomes an issue when when adding a new ::animal subclass ::fly: the code above must be changed to take it into account. If globbing were allowed in trap patterns, the same could be accomplished as follows: try { $a feed $x; } trap {* BADFOOD} {} { $a drink } This new behaviour could be specified via a flag similar to switch's -glob and -regexp. - foundin initialized to: "8.6"
- is_private initialized to: "0"
- login: "adrianmedranocalvo"
- priority initialized to: "5 Medium"
- private_contact initialized to: "7e3820ed81064cf9306d34dd9be1633e66f1a08b"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "adrianmedranocalvo"
- subsystem initialized to: "None"
- title initialized to: "Allow globs in trap patterns"
- type initialized to: "RFE"
Ticket change [81762af683] (rid 148018) by dkf on 2016-07-14 08:09:27:
- assignee changed to: "dkf"
- icomment:
Why not use the class name as a suffix? Then the existing prefix machinery will “just work”.
- login: "dkf"
- mimetype: "text/x-fossil-wiki"
- subsystem changed to: "18. Commands M-Z"
- username: "dkf"