For example, instead of for I want to write аа . I tried it

 proc aa {abcd} { for {$a} {$b} {$c} {$d} } aa {set k 0} {$k<5} {incr k} {puts $k} 

but failed.

  • Instead of the script label, specify the programming language. - Visman
  • I tried to tcl but didn’t have such a label, but I ’m not allowed to create a new one - user190580
  • Is he ru.wikipedia.org/wiki/Tcl ? - Visman
  • yes it is he, I also wrote the name of the language in question - user190580

1 answer 1

Try passing the arguments to the for command directly, with no additional braces around the arguments:

 $ tclsh % proc aa {abcd} { for $a $b $c $d } % aa {set k 0} {$k<5} {incr k} {puts $k} 0 1 2 3 4 % % # проверка % for {set k 0} {$k<5} {incr k} {puts $k} 0 1 2 3 4 % 
  • It turned out, thanks a lot))) - user190580
  • if the answer resolves your problem, please mark it as accepted ("checkmark" to the left of the answer). - aleksandr barakin