|
From: Donal F. <don...@ma...> - 2025-11-02 09:04:59
|
Doing the job properly would definitely involve changing the expression parser, with my suggested fix being to turn all bare words not otherwise recognised as constants or in positions that look like function calls (it's a parser with some lookahead) into simple variable reads (NB: C resolves such ambiguities within itself differently, but that's one of the nastiest parts of the language). We would need to retain $ support for resolving ambiguity (e.g., array reads vs function calls; you can't safely inspect the interpreter to resolve it at the time of compiling the expression due to traces and unknown handlers) as well as compatibility, but that's doable as it is a change only in cases that are currently errors. Adding assignment is quite a bit trickier, as that needs a new major syntax class to describe the left side of the assignment. I suggest omitting that from consideration at this stage. Donal. -------- Original message -------- From: Colin Macleod via Tcl-Core <tcl...@li...> Date: 02/11/2025 08:13 (GMT+00:00) To: Pietro Cerutti <ga...@ga...> Cc: tcl...@li..., av...@lo... Subject: Re: [TCLCORE] Fwd: TIP 672 Implementation Complete - Ready for Sponsorship Indeed, this toy implementation doesn't handle that: % = sin (12) can't read "sin": no such variable I'm not sure that's serious, but it could be fixed in a C implementation. |