Overview
| Artifact ID: | 83d54d713fff80d67ac5d0e9151093abfcbd1b8f |
|---|---|
| Ticket: | 218127ffffffffffffffffffffffffffffffffff
'space commands' to solve major/minor |
| User & Date: | nobody on 2000-10-26 00:53:27 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 1986 RFE Version: 8.0.5 SubmitDate: '1999-05-04' LastModified: '2000-01-12' Severity: LOW Status: Closed Submitter: pat ChangedBy: hobbs OS: All OSVersion: NA Machine: NA FixedDate: '2000-10-25' FixedInVersion: NA ClosedDate: '2000-01-12' Name: Alexandre FERRIEUX DesiredBehavior: Idea: interpreting whitespace in a proc name as a subcommand override. Example: # Today we handle subcommands this way: proc a {sub args} { switch -- $sub { b {...} c {...} default {error "a: Unknown subcommand '$sub'"} } } # With 'space commands' we'd do instead: proc a {sub args} {error "a: Unknown subcommand '$sub'"} proc "a b" args {...} proc "a c" args {...} Detailed mechanism: when evaluating a command line "a b c d e", Tcl would first look for a proc named "a b c d e", then "a b c d", ..., then "a". Notice that this can be made fairly efficient, by using the base proc as an anchor (basename) where we'd store a linked list of special cases, ordered by decreasing length; e.g. if "a b c" and "a b c d e" are overridden, the structure linked with procedure "a" would contain the list {{4 "b c d e"} {2 "b c"}}. The comparisons with the actual parameter list could be done on strings, or lists, or hash values. Notice that for the 99% of procs with no subcommand override, this list would be empty, hence no performance drag. Benefit: this solves the major/minor way in a way that's very natural in Tcl. While the concept of major/minor is important, this is an incompatible, and somewhat odd was of achieving such behavior. We'd rather explore more natural command extension possibilities. -- 01/12/2000 hobbs - foundin changed to: "final: 8.0.5"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "81. Bundled Packages"
- title changed to: "'space commands' to solve major/minor"
- type changed to: "RFE"