|
From: Kevin W. <kw...@co...> - 2025-10-22 19:09:18
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">This will be a hard sale for me. I have yet to fully understand the tradeoffs, ie does variable substitution change? [expr] is ugly but it is self-contained. </div><div dir="ltr"><br><blockquote type="cite">On Oct 22, 2025, at 2:44 PM, da Silva, Peter J <pet...@fl...> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style>@font-face { font-family: "Cambria Math"; }
@font-face { font-family: Calibri; }
@font-face { font-family: Aptos; }
p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif; }
a:link, span.MsoHyperlink { color: blue; text-decoration: underline; }
span.unicodexl { }
span.mkuptt { }
span.EmailStyle23 { font-family: Aptos, sans-serif; color: windowtext; }
.MsoChpDefault { font-size: 10pt; }
@page WordSection1 { size: 8.5in 11in; margin: 1in; }
div.WordSection1 { page: WordSection1; }</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">That doesn’t seem any better than “set x [= {$y + 1}]”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">And the Unicode version gives me flashbacks to early Smalltalk and APL.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I started out in favor of the “$(...)” syntax but this is turning into creeping Perlism.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">Florent Merlet <flo...@gm...><br>
<b>Date: </b>Wednesday, October 22, 2025 at 13:20<br>
<b>To: </b>Zaumseil René <RZa...@kk...>, tc...@ro... <tc...@ro...><br>
<b>Cc: </b>et...@ro... <et...@ro...>, tcl...@li... <Tcl...@li...><br>
<b>Subject: </b>Re: [TCLCORE] [Ext] Re: TIP 672 Implementation Complete - Ready for Sponsorship<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-line-height-alt:.75pt"><span style="font-size:1.0pt;color:white">Another alternative proposal : set x [($y+1)] It is very readable, easy to write, there is eventually a unicode version set x
</span><span style="font-size:1.0pt;font-family:"Cambria Math",serif;color:white">〖</span><span style="font-size:1.0pt;color:white">$y+1</span><span style="font-size:1.0pt;font-family:"Cambria Math",serif;color:white">〗</span><span style="font-size:1.0pt;color:white">
1 . We define a new kind of substitution RULE [7'] Expression substitution : If a word contains an open bracket<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-line-height-alt:.75pt"><span style="font-size:1.0pt;color:white"><o:p></o:p></span></p>
</div>
<p>Another alternative proposal : <o:p></o:p></p>
<p>set x [($y+1)]<o:p></o:p></p>
<p>It is very readable, easy to write, there is eventually a unicode version <o:p></o:p></p>
<p><span class="unicodexl">set x </span><span class="unicodexl"><span style="font-family:"Cambria Math",serif">〖</span>$y+1</span><span class="unicodexl"><span style="font-family:"Cambria Math",serif">〗</span></span><o:p></o:p></p>
<p>1 . We define a new kind of substitution<o:p></o:p></p>
<p>RULE [7'] Expression substitution :<o:p></o:p></p>
<p>If a word contains an open bracket <b>«<span class="mkuptt"> [ »</span></b> immediately followed by an open parenthesis « ( », then Tcl performs an Expression substitution. To do this it invokes the Tcl interpreter recursively to process the characters following
the open parenthesis as a Tcl mathematical Expression. The Expression must be terminated by a close bracket « <span class="mkuptt"><b>] » </b></span>immediately preceded by a closed parenthesis « ) ». The result of the expression is substituted into the word
in place of the brackets-parenthesis and all of the characters between them. There may be any number of expression substitutions in a single word. Expression substitution is not performed on words enclosed in braces.<o:p></o:p></p>
<p>2. We create the test in ParseToken<o:p></o:p></p>
<p>... else if (*src == '[') {<o:p></o:p></p>
<p> if (src[1] == '(') {<o:p></o:p></p>
<p> // Expression substitution<o:p></o:p></p>
<p> // must finish by « )] »<o:p></o:p></p>
<p> // doesn't know how to do it... <o:p></o:p></p>
<p> } else {<o:p></o:p></p>
<p> // Command substitution<o:p></o:p></p>
<p> }<o:p></o:p></p>
<p>3. we create a -noexpr switch in the subst command<o:p></o:p></p>
<p>....<o:p></o:p></p>
<p>Examples :<o:p></o:p></p>
<p>inline expression : string range "my long sentence" 0 end-[($x+2)]<o:p></o:p></p>
<p>With native list expr enancement : .c create rectangle {*}[( $X , $Y, $X+100, $Y+100 )]<o:p></o:p></p>
<p>With multiples instructions enhancement : set multiexpr [( x = 1; y = 2; $x-$y, $y-$x )]<o:p></o:p></p>
<p>Readable, easy to type, test logically positionned in the C source code, no double substitution, avoiding confusion with variable substitution : This is the solution !<o:p></o:p></p>
<p>Florent<o:p></o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">Le 22/10/2025 à 15:52, Zaumseil René a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">And how will this be documented? Imho it should be mentioned in the dodecalogue.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Currently the used syntax is only used as array variable and not as math command.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">I remember the big discussion on {*} syntax here.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Again, is this change really more readable and useable?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Is the benefit worth the additional syntax.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Why not create real benefit with p.e. a multiple set command ala tip 674.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Or a new math command without need of $.. access to variables.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Regards</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">rene</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Florent Merlet
<a href="mailto:flo...@gm..."><flo...@gm...></a> <br>
<b>Gesendet:</b> Mittwoch, 22. Oktober 2025 15:39<br>
<b>An:</b> <a href="mailto:tc...@ro...">tc...@ro...</a><br>
<b>Cc:</b> <a href="mailto:et...@ro...">et...@ro...</a>; <a href="mailto:tcl...@li...">
tcl...@li...</a><br>
<b>Betreff:</b> [Ext] Re: [TCLCORE] TIP 672 Implementation Complete - Ready for Sponsorship</span><o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">So, everybody in the core team agree with the implementation of a new math-Expression substitution as a memlink command into the procedure in charge of variable name substitution ? <o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Le mer. 22 oct. 2025, 14:07, EricT <<a href="mailto:tw...@gm...">tw...@gm...</a>> a écrit :<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hi everyone,<br>
<br>
I wanted to update you on the status of TIP 672 (expression substitution syntax).<br>
<br>
The prototype implementation is now complete and available at:<br>
<a href="https://urldefense.us/v2/url?u=https-3A__github.com_rocketship88_tcl-2Dtip-2D672-2Dprototype&d=DwMDaQ&c=MASr1KIcYm9UGIT-jfIzwQg1YBeAkaJoBtxV_4o83uQ&r=BRyGRggIJd8TmKOhvEmGElFuDuCl3O5mT8opva3f-Uc&m=iT87BgHPQz_A0uNwlVbY84Y5W9eaZzr61JhUIsKkQHMwBqGb0HSqTCupNpvqyeMR&s=ZG5I9vay2CgB9hUAk2I-pkA-6Y6ofRO4-983kuM23Nw&e=" target="_blank">https://github.com/rocketship88/tcl-tip-672-prototype</a><br>
<br>
The implementation has been parameterized to support both discussed approaches with a simple compile-time flag:<br>
- Mode 1: $(expr) syntax<br>
- Mode 2: $=(expr) or $^(expr) - configurable character<br>
<br>
Key features:<br>
- Comprehensive test suite (82 tests covering edge cases)<br>
- Minimal code changes (~100 lines)<br>
- Clean integration with existing parser<br>
- Full Tcl test suite passes (only 3 expected differences)<br>
<br>
There is one known issue: a minor memory leak in the synthetic command strings that will need attention during integration.<br>
<br>
At this point, I need a sponsor to upload the code to a TIP branch on Fossil so the core team can review and decide whether to adopt the TIP and, if so, which syntax to use. I'm available for any collaborative work, questions, or modifications needed.<br>
<br>
I'm grateful for all the feedback and support from the community. I look forward to the next steps in the process.<br>
<br>
Best regards,<o:p></o:p></p>
<div>
<p class="MsoNormal">Eric<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Tcl-Core mailing list<br>
<a href="mailto:Tcl...@li..." target="_blank">Tcl...@li...</a><br>
<a href="https://urldefense.us/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_tcl-2Dcore&d=DwMDaQ&c=MASr1KIcYm9UGIT-jfIzwQg1YBeAkaJoBtxV_4o83uQ&r=BRyGRggIJd8TmKOhvEmGElFuDuCl3O5mT8opva3f-Uc&m=iT87BgHPQz_A0uNwlVbY84Y5W9eaZzr61JhUIsKkQHMwBqGb0HSqTCupNpvqyeMR&s=4iEQfafWSb-GM4h7dq1Qztghg-qOF6HjeF8W3XUHIzs&e=" target="_blank">https://lists.sourceforge.net/lists/listinfo/tcl-core</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
<span>_______________________________________________</span><br><span>Tcl-Core mailing list</span><br><span>Tcl...@li...</span><br><span>https://lists.sourceforge.net/lists/listinfo/tcl-core</span><br></div></blockquote></body></html> |