As an experiment in learning TCL, I tried doing an advent of code puzzle in TCL; once I'd finished, I tried running it in Molt. It did not work because of a lack of file i/o. Fair enough! However, the first problem I hit was the error
can't read "argc": no such variable
argc is a documented tcl global when running with a shell-type interpreter, like argv. In my testing¹, moltsh supports argc but not argv. My "expected behavior" is if you support one, you should support both; having argc independent of argv is useful because you can quickly test if the number of arguments is as expected.
¹ Running with the above script and ~/work/gr/other/molt/target/release/moltsh shell src/puzzle.tcl data/sample.143.txt
As an experiment in learning TCL, I tried doing an advent of code puzzle in TCL; once I'd finished, I tried running it in Molt. It did not work because of a lack of file i/o. Fair enough! However, the first problem I hit was the error
argc is a documented tcl global when running with a shell-type interpreter, like argv. In my testing¹, moltsh supports argc but not argv. My "expected behavior" is if you support one, you should support both; having argc independent of argv is useful because you can quickly test if the number of arguments is as expected.
¹ Running with the above script and
~/work/gr/other/molt/target/release/moltsh shell src/puzzle.tcl data/sample.143.txt