• Re: Subject: TIP 672 Prototype: $(expr) syntax is working!

    From Colin Macleod@user7@newsgrouper.org.invalid to comp.lang.tcl on Thu Dec 11 15:37:37 2025
    From Newsgroup: comp.lang.tcl

    Colin Macleod <user7@newsgrouper.org.invalid> posted:

    I just made yet another proposal: https://sourceforge.net/p/tcl/mailman/message/59251190/


    I have now modified TIP 676 to this later proposal:
    https://core.tcl-lang.org/tips/doc/trunk/tip/676.md
    and made an implementation which is on branch cgm-equals-command
    in the Tcl core repository:
    https://core.tcl-lang.org/tcl/timeline?r=cgm-equals-command

    The main difference from my earlier proposal is to treat bare words
    without $ as variable names in the expression. Some TCT members are
    supportive, others less so. I am hoping it can be voted on early in
    the new year, in time to be included in Tcl9.1a1.
    --
    Colin Macleod ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ https://cmacleod.me.uk

    FEED FEED FEED FEED FEED FEED FEED FEED
    GAZA GAZA GAZA GAZA GAZA GAZA GAZA GAZA
    NOW! NOW! NOW! NOW! NOW! NOW! NOW! NOW!
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Tristan Wibberley@tristan.wibberley+netnews2@alumni.manchester.ac.uk to comp.lang.tcl on Thu Dec 11 23:47:24 2025
    From Newsgroup: comp.lang.tcl

    On 17/10/2025 23:23, et99 wrote:
    I've implemented a working prototype of TIP 672 - the $(expression)
    syntax for Tcl.

    Instead of:
    -a set result [expr {$a + $b * $c}]
    -a puts "Total: [expr {$sum + $tax}]"

    You can now write:
    -a set result $($a + $b * $c)
    -a puts "Total: $($sum + $tax)"

    ...

    Thoughts? Does anyone see issues I haven't considered?

    One biggy: It's another irregularity making programming, which is
    difficult, even more so. It doesn't take long for them to compose
    together into development gridlock.

    Tcl has so far been a bastion of syntactically NotRubbish. Please try to
    keep it so for all our sakes.

    If it's just a matter of typing '[expr ' instead of '$(' then don't do
    it without super special reasons, and if the expression syntax has lots
    of pitfalls it would be a grave error to give it the prime syntactic
    position.

    Because of the workload to do useful things correctly, the Tcl
    maintainers are already simplifying Tcl with otherwise needless breaking changes. If you make it harder for them and also harder for users to
    understand Tcl and predict what and how to do things from documentation
    then it'll just devalue Tcl.
    --
    Tristan Wibberley

    The message body is Copyright (C) 2025 Tristan Wibberley except
    citations and quotations noted. All Rights Reserved except that you may,
    of course, cite it academically giving credit to me, distribute it
    verbatim as part of a usenet system or its archives, and use it to
    promote my greatness and general superiority without misrepresentation
    of my opinions other than my opinion of my greatness and general
    superiority which you _may_ misrepresent. You definitely MAY NOT train
    any production AI system with it but you may train experimental AI that
    will only be used for evaluation of the AI methods it implements.

    --- Synchronet 3.21a-Linux NewsLink 1.2