Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Incorrect order of substitution with curly braces in square braces #7

Open
chanibal opened this issue Nov 13, 2019 · 2 comments
Open

Comments

@chanibal
Copy link
Contributor

I'm having an issue that I can't fix. When in {...} context embedded in a [...] context, variables are substituted - while they should not be.

An example:

puts "Bare:"
proc p1 {} { set v 111; puts "p1: $v" }
p1

puts "Braced: [proc p2 {} { set v 222; puts "p2: $v" }]"
p2

Fiz executes as:

Bare:
p1: 111
error: Unknown variable 'v' in "puts "Proc: [proc p2 {} { set v 222; puts "p2: $v"

TCLSH executes as:

Bare:
p1: 111
Braced:
p2: 222

This example might look a bit abstract, but is a simple case of another issue I'm having (adding catch support).

The "unknown variable" error is from parse_quote. I managed to add detecting {...} in there (dirty hack breaking other things, won't commit), but then I ran into another "unknown variable" error in get_word. That one, I can't seem to find a fix for.

Any chance for a fix, @wernsey ?

@wernsey
Copy link
Owner

wernsey commented Nov 15, 2019

@chanibal I don't know how difficult it would be to fix, but I can't think what to do off the top of my head, and unfortunately I haven't had a lot of time to work on these kinds of things lately,

@chanibal
Copy link
Contributor Author

@wernsey I understand the lack of time - don't have much myself.
This issue is not critical, but it'd be nice if you fix it at some point. This is quite an annoying incompatibility. Will add that to README.md next to the if { expr ... } thing the next time I push something.

Oh, and would you like some usage docs? Mostly command descriptions, had to do them for my use anyway and porting them shouldn't be hard, just truncate internal stuff. I don't have any syntax basics written down, but a few links to TCL docs and a list of incompatibilities should be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants