You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.1 KiB
58 lines
1.1 KiB
2 years ago
|
|
||
|
#-----------------------------------------------------------
|
||
|
# a formatting experiment
|
||
|
#-----------------------------------------------------------
|
||
|
|
||
|
x.=val {
|
||
|
a
|
||
|
b c
|
||
|
d e f
|
||
|
g h i
|
||
|
} |> {
|
||
|
|
||
|
|
||
|
|
||
|
set data} |> {
|
||
|
|
||
|
|
||
|
set data} |> {
|
||
|
|
||
|
puts "raw: $data"
|
||
|
set data
|
||
|
} \
|
||
|
|> \
|
||
|
\
|
||
|
\
|
||
|
l.=linelist %data%\
|
||
|
\
|
||
|
|> \
|
||
|
{
|
||
|
puts "linelist: $data"
|
||
|
puts "args: $args"
|
||
|
set data
|
||
|
} \
|
||
|
<args| a b c
|
||
|
#-----------------------------------------------------------
|
||
|
|
||
|
set input [list a b c d e f g]
|
||
|
|
||
|
a.=val $input |> {
|
||
|
|
||
|
.=lrange $data 1 end-1 |>\
|
||
|
b.=string toupper
|
||
|
|
||
|
puts stdout "=================================="
|
||
|
puts stdout [info vars]
|
||
|
foreach v [info vars] {
|
||
|
puts stderr " '$v'"
|
||
|
}
|
||
|
puts stdout "=================================="
|
||
|
return $b
|
||
|
} |> b.=val
|
||
|
|
||
|
puts $a
|
||
|
puts $b
|
||
|
|
||
|
|
||
|
|