Overview
| Artifact ID: | ee6ab741b1e001615999c7095379203272b11448 |
|---|---|
| Ticket: | c1281082718e963be1b5c30ad0be9e895d26b40e
Allow globs in trap patterns |
| User & Date: | adrianmedranocalvo on 2016-07-13 07:49:14 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed 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 changed to: "8.6"
- is_private changed to: "0"
- login: "adrianmedranocalvo"
- priority changed to: "5 Medium"
- private_contact changed to: "7e3820ed81064cf9306d34dd9be1633e66f1a08b"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "adrianmedranocalvo"
- subsystem changed to: "None"
- title changed to: "Allow globs in trap patterns"
- type changed to: "RFE"