Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Weird errors printing strings #29

Closed
skx opened this issue Jul 6, 2022 · 1 comment · Fixed by #32
Closed

Weird errors printing strings #29

skx opened this issue Jul 6, 2022 · 1 comment · Fixed by #32
Assignees
Labels
bug Something isn't working stdlib

Comments

@skx
Copy link
Owner

skx commented Jul 6, 2022

This is almost certainly going to turn out to be related to expansion.

Consider this program, to print a string five times:

repeat 5 { puts " * " }

Works just fine:

$ ./critical newline.tcl 
 * 
 * 
 * 
 * 
 * 

Result: * 

Now remove the spaces:

repeat 5 { puts "*" }

And suddenly:

frodo ~/critical $ ./critical err.tcl 
*
*
*
*
*
Error running program:function argument mismatch, * takes 2 arguments, 0 supplied

Replacing * with +, or similar, produces the same error message.

@skx skx self-assigned this Jul 6, 2022
@skx skx added the bug Something isn't working label Jul 6, 2022
@skx
Copy link
Owner Author

skx commented Jul 6, 2022

Edit - This is caused by the way the return-value is handled from our repeat/for methods and is a simple fix :)

@skx skx added the stdlib label Jul 6, 2022
skx added a commit that referenced this issue Jul 6, 2022
This stops them being interpreted as commands to execute in some
cases - which closes #29.
@skx skx closed this as completed in #32 Jul 6, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working stdlib
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant