Okay, this one has me chasing my tail. Tcl 9.0 on Arch, tclsh main.tcl, small order report for a client's hardware-supply site.
I had one rule in config.tcl (total >= 200) and everything was happy. Then I added a second rule so orders with a customer note get flagged too:
set ::flag_rules {
{total >= 200}
{note ne {}}
}
Now the run dies partway through with invalid command name "Dana". The trace points at the expr line in rule_match:
proc rule_match {row rule} {
lassign $rule field op value
set have [dict get $row $field]
return [expr "\"$have\" $op \"$value\""]
}
"Dana" isn't a command anywhere in my code. It's in the data. One of the bigger orders has this note in orders.tsv:
1003 Petrakis Plumbing 1250.75 call [Dana] before shipping
Other notes (like "leave at side door") go through fine. I printed the row dict right before the crash and it looks totally normal. Tabs split right, all four fields in place, note intact. So I've been poking at load_orders for an hour, convinced the client's export has some weird encoding thing or a stray byte. Checked in Neovim with :set list, tabs look like tabs. (Side note: why does their export have a trailing tab on the empty-note rows but not on 1005? Different problem, different day.)
What I can't see is how a string sitting in a dict becomes a command call. Nothing evals it. Why only this row?