我遇到了一個場景,我需要使用參數擴展命令format
。使用Tcl8.5,我使用的是{*}
,它的工作原理類似於魅力。帶格式命令的參數擴展
但是,用Tcl8.4,我試過eval
。但是,沒有運氣。
% set x "This is stackoverflow"
This is stackoverflow
% format "%10s %5s %20s" {*}$x
This is stackoverflow
% eval format "%10s %5s %20s" $x
%5s
% eval list format "%10s %5s %20s" $x
format %10s %5s %20s This is stackoverflow
% eval [list format "%10s %5s %20s" $x]
not enough arguments for all format specifiers
% eval format "%10s %5s %20s" [list $x]
%5s
% eval format "%10s %5s %20s" [concat $x]
%5s
這是什麼錯誤?
你都知道,8.4不支持? –