Description: |
(text/x-fossil-wiki)
<code>tailcall</code> confuses the unknown handler of a namespace ensemble. The following
script,
<code><verbatim>
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]
</verbatim></code>
results in the error:
<verbatim>
unknown subcommand "x": namespace ::ns1 does not export any commands
</verbatim>
However, if the word "tailcall" is removed, then the result is as expected:
<verbatim>
one two three
</verbatim>
|