Artifacts Associated With Ticket f27930150a84a15b
Ticket change [4f49fe57f4] (rid 153378) by pooryorick on 2017-04-28 13:47:00:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Some wild ensemble command behaviour when the name of the subcommand is the empty string: <verbatim> namespace eval n1 { namespace export * namespace ensemble create namespace ensemble configure [namespace current] -map { p1 {::puts yada} } } n1 {} ;# -> yada proc n1:: {} {puts foo} n1 {} ;# -> yada namespace ensemble configure n1 -map {} ; n1 {} ;# -> foo namespace ensemble configure n1 -map {p1 {::puts yada} p2 {::puts bar}} n1 {} ;#-> unknown or ambiguous subcommand "": must be p1, or p2 </verbatim> - foundin initialized to: "8.7"
- is_private initialized to: "0"
- login: "pooryorick"
- priority initialized to: "5 Medium"
- private_contact initialized to: "e476148cded301ffff84bcdc432536dc0c949e88"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "pooryorick"
- subsystem initialized to: "21. [namespace]"
- title initialized to:
namespace ensemble subcommands with the empty string for a name
- type initialized to: "Bug"
Ticket change [38a6c672ab] (rid 153389) by aspect on 2017-04-28 15:39:16:
- icomment:
This is a result of the default configuration `-prefixes true`: {} is an unambiguous prefix of p1. - login: "aspect"
- mimetype: "text/plain"
- icomment:
Ticket change [434764c05c] (rid 153452) by dkf on 2017-05-02 10:31:01:
- closedate changed to: "2457875.93821101"
- closer changed to: "dkf"
- icomment:
The behaviour you describe is correct. There is no bug. <p> When an ensemble has an empty <tt>-map</tt> (and empty <tt>-subcommands</tt> list), it uses the exported commands of the namespace as the set of subcommands. When an ensemble has a non-empty <tt>-map</tt>, it uses the keys of that map to determine what the set of subcommands is. <i>In both cases</i>, it then finds whether there is an exact match for the subcommand name against its set of possible subcommands, and if there is no exact match and the <tt>-prefix</tt> option is true (the default), then sees whether the provided subcommand name is a prefix of exactly one subcommand name. (If there's two or more subcommands that could match, that's an error. The empty string is a prefix of all other strings of course.)
- login: "dkf"
- mimetype: "text/html"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dkf"
Ticket change [45cb3f4896] (rid 153453) by dkf on 2017-05-02 10:31:40:
- assignee changed to: "dkf"
- closedate changed to: "2457875.93866211"
- login: "dkf"
- mimetype: "text/plain"