Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2021-06-21
06:47 • Ticket [934e6eb9cf] ensemble unknown handler confused by tailcall status sti... artifact: d5322ce955 user: pooryorick
2020-01-03
20:04 • New ticket [934e6eb9cf]. artifact: 6d1dba9df5 user: pooryorick

ensemble unknown handler confused by tailcall

Open934e6eb9cf15782433ffbc2f56cecdac30c596f5Created 7 years agoUpdated 5 years ago
Descriptionwiki2020-01-03 20:04:41
tailcall confuses the unknown handler of a namespace ensemble. The following script,

namespace eval ns1 {
    proc dispatch {routine args} {
        return list
    }
    namespace ensemble create -unknown [
    list ::apply [list {ensemble routine args} {
        tailcall dispatch $routine {*}$args
    } [namespace current]]]
}

puts [ns1 x one two three]

results in the error:

unknown subcommand "x": namespace ::ns1 does not export any commands

However, if the word "tailcall" is removed, then the result is as expected:

one two three
pooryorick Ticket [934e6eb9cf]: 3 changes [History diff]2021-06-21 06:47:43
Log in (anonymous is fine) to add a comment.