• support for built-in -opt style options for proc

    From Mark Summerfield@21:1/5 to All on Mon Jun 24 08:11:18 2024
    I want to create a couple of procs with these usages:

    dialog::prepare ?-parent .? ?-modal true? window

    I can't use the parse_args package because I don't know how to install it
    (and it has no INSTALL doc)

    I can see from the wiki that there seems to be a lot of different pure Tcl solutions, so I don't know which one to choose.

    I'm using Tcl/Tk 9.0b2.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Mark Summerfield on Mon Jun 24 12:49:01 2024
    On 6/24/2024 1:11 AM, Mark Summerfield wrote:
    I want to create a couple of procs with these usages:

    dialog::prepare ?-parent .? ?-modal true? window

    I can't use the parse_args package because I don't know how to install it (and it has no INSTALL doc)

    I can see from the wiki that there seems to be a lot of different pure Tcl solutions, so I don't know which one to choose.

    I'm using Tcl/Tk 9.0b2.

    You can use an argument processor or if you just want an ad-hoc parser, something like this (partially written by chatGPT):

    proc parseit {args} {
    puts "\nargs= |$args| "
    lassign {. true } parent modal ;# set default values
    while {1} {
    set args [lassign $args option value] ;# peel off 2 args and shift rest back to args
    if { [string index $option 0] ne "-" } {
    if { $value ne "" } {
    error "too many arguments, should be: ?-parent .? ?-modal true? window"
    }
    set window $option ;# not an option, so must be the window
    break
    }
    # allow abbreviations
    switch -glob $option {
    -par* { set parent $value }
    -mod* { set modal $value }
    default { error "Invalid option: $option" }

    }
    if { $value eq "" } {
    error "missing value for argument $option"
    }

    puts "option= |$option| value= |$value| "
    }

    # ... validate options and required window argument here ...

    if { $window eq "" } {
    error "missing window argument"
    } elseif { [string index $window 0] ne "." } {
    error "window must begin with a ."
    }


    puts "parent= |$parent| modal= |$modal| window= |$window| "
    }


    parseit -par .par .window
    parseit .justwindow
    parseit -mod false .mywindow
    parseit -mod 0 -par .parent .thewindow



    output:


    args= |-par .par .window|
    option= |-par| value= |.par|
    parent= |.par| modal= |true| window= |.window|

    args= |.justwindow|
    parent= |.| modal= |true| window= |.justwindow|

    args= |-mod false .mywindow|
    option= |-mod| value= |false|
    parent= |.| modal= |false| window= |.mywindow|

    args= |-mod 0 -par .parent .thewindow|
    option= |-mod| value= |0|
    option= |-par| value= |.parent|
    parent= |.parent| modal= |0| window= |.thewindow|

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to All on Mon Jun 24 14:02:36 2024
    On 6/24/2024 12:49 PM, et99 wrote:
    snip

    You can use an argument processor or if you just want an ad-hoc parser, something like this (partially written by chatGPT):


    For fun, I just tried it this way with chatGPT (before I was too wordy):

    "can you write a tcl procedure that processes variable arguments of the standard form with: ?-parent .? ?-modal true? window"

    And got this which worked first time, but doesn't do the defaults or any error checking:


    proc processArgs {args} {
    # Default values
    set parent ""
    set modal false
    set window ""

    # Parse the arguments
    while {[llength $args] > 0} {
    switch -- [lindex $args 0] {
    -parent {
    set parent [lindex $args 1]
    set args [lrange $args 2 end]
    }
    -modal {
    set modal [string equal -nocase [lindex $args 1] "true"]
    set args [lrange $args 2 end]
    }
    default {
    set window [lindex $args 0]
    set args [lrange $args 1 end]
    }
    }
    }

    # Print the results (or do whatever processing is needed)
    puts "Parent: $parent"
    puts "Modal: $modal"
    puts "Window: $window"
    }

    # Example usage
    processArgs -parent . -modal true myWindow
    processArgs -modal false myWindow
    processArgs myWindow

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to All on Mon Jun 24 14:06:12 2024
    On 6/24/2024 2:02 PM, et99 wrote:
    On 6/24/2024 12:49 PM, et99 wrote:

    And got this which worked first time, but doesn't do the defaults or any error checking:

    Actually I just noticed it does do the defaults but gets them wrong. However, easy to fix.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Pitcher@21:1/5 to Mark Summerfield on Tue Jun 25 09:56:31 2024
    On Mon, 24 Jun 2024 08:11:18 +0000
    Mark Summerfield <[email protected]> wrote:

    I want to create a couple of procs with these usages:

    dialog::prepare ?-parent .? ?-modal true? window

    I can't use the parse_args package because I don't know how to
    install it (and it has no INSTALL doc)

    I can see from the wiki that there seems to be a lot of different
    pure Tcl solutions, so I don't know which one to choose.

    I'm using Tcl/Tk 9.0b2.

    With Tcl you can do quite good option and argument processing inline
    with no dependencies.

    If you have a single option you can do something like this.

    # Takes a single binary option "-big"
    proc name {arg1 arg2 {opt ""}} {
    set opts(-big) 0
    if {$opt == "-big"} {
    set $opts($opt) 1
    } elseif {$opt != ""} {
    error "name: unknown option \"$opt\""
    }

    ...
    if {$opts(-big)} {
    # Some special activity when big
    ...
    }
    }

    To handle multiple options both binary and with arguments:

    # Takes several options
    proc name {args} {
    set opts(-big) 0
    set opts(-small) 0
    set opts(-filename) ""
    set opts(-title) ""

    while {[llength $args] > 0} {
    set args [lassign $args opt]
    switch -glob -- $opt {
    -filename - -title {
    # Handle any option with argument
    set args [lassign $args param]
    set opts($opt) $param
    }
    -big - -small {
    # Handle any binary option.
    set opts($opt) 1
    }
    -* {
    error "name: unknown option \"$opt\""
    }
    default {
    error "name: unknown argument \"$opt\""
    }
    }
    }

    # Check arguments here.
    if {$opts(-big) == 0 && $opts(-small)} {
    # Must be medium ....
    }
    .....
    }

    To handle one or more arguments (non options in other words) you can
    either add them as fixed arguments to the function -

    proc name {arg1 arg2 args} ....

    Or, you can add argument processing to the option processor. This is
    more useful when you may have a variable number of arguments -

    proc name {args} {
    set opts(n) 0 ; # Count of non option arguments
    set opts(-big) 0
    ....

    while {[llength $args] > 0} {
    set args [lassign $args opt]
    switch -glob -- $opt {
    ....
    -* {
    error "name: unknown option \"$opt\""
    }
    default {
    set opts([incr opts(n)]) $opt
    }
    }
    }

    # Check arguments here.
    if {$opts(n) == 1} {
    # Special case with only single argument
    } elseif {$opts(n) == 2} {
    # Special case with two arguments
    } else {
    error "name: invalid arguments, must be name arg1 \[arg2\]
    ?options?"
    }
    .....
    }

    Or -

    proc name {args} {
    ....
    # Check arguments here.
    if {$opts(n) != 3} {
    error "name: invalid arguments, must be name arg1 arg2 arg3
    ?options?"
    }
    .....
    }

    You can also leave out the defaults and check for the existence of
    an opt(...) variable.

    By using an opts array I can share it where necessary. I've taken to
    calling the global application arguments, those passed to the program,
    "Opts" and making that a variable or global to be accessed by other
    parts of the code. They are global options after all.

    It was designed to be inline and have no dependencies, and be simple
    enough to handle special cases e.g. sometimes I need to collect
    arguments and lappend them to a list. It also handles short options
    with an OptsMap array mapping short to long, but I won't go into that.

    Kind regards,
    Scott


    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Tue Jun 25 08:14:55 2024
    Am 24.06.24 um 10:11 schrieb Mark Summerfield:
    I want to create a couple of procs with these usages:

    dialog::prepare ?-parent .? ?-modal true? window

    Here is another very simple argument parser: Use "dict merge".

    proc someprocwithargs {args} {
    set defaults {-parent . -modal false}
    set options [dict merge $defaults $args]
    if {[dict size $options] != [dict size $defaults]} {
    return -code error "Unknown option"
    }
    # now use the stuff in options
    }

    To extend by a mandatory argument is left as an exercise to the reader,
    you basically take off the last element from "args". It is advisable to
    do it this way, i.e. to make the mandatory argument positional, either
    in the beginning - then you can simple stuff it before "args" - or at
    the end. This way, an option can not be confused with a positional
    argument, and no "--" stuff is needed.

    There have also been LOTS of advanced implementations in pure Tcl around
    the discussion of TIP 457
    https://core.tcl-lang.org/tips/doc/trunk/tip/457.md

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to Gerald Lester on Tue Jun 25 07:01:31 2024
    On Mon, 24 Jun 2024 08:13:09 -0500, Gerald Lester wrote:

    On 6/24/24 03:11, Mark Summerfield wrote:
    I want to create a couple of procs with these usages:

    dialog::prepare ?-parent .? ?-modal true? window

    I can't use the parse_args package because I don't know how to install
    it (and it has no INSTALL doc)

    I can see from the wiki that there seems to be a lot of different pure
    Tcl solutions, so I don't know which one to choose.

    I'm using Tcl/Tk 9.0b2.

    Look first to TclLib -- https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/
    modules/tepam/tepam_introduction.md

    I had peeked at that but was put off by there being no 'examples' section.
    I'll have another look at it.

    Thanks also to the other repliers, but I want something 'standards' rather
    than ad hoc. I do find it surprising that it isn't part of Tcl itself.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 25 09:11:56 2024
    Am 25.06.2024 um 09:01 schrieb Mark Summerfield:
    Thanks also to the other repliers, but I want something 'standards' rather than ad hoc. I do find it surprising that it isn't part of Tcl itself.

    Yes, see my comment on the TIP which may bring us this functionality.
    All is practically there, but we frightened the people...

    Sorry,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 25 09:05:02 2024
    Am 25.06.2024 um 08:14 schrieb Christian Gollwitzer:
    There have also been LOTS of advanced implementations in pure Tcl around
    the discussion of TIP 457
    https://core.tcl-lang.org/tips/doc/trunk/tip/457.md

        Christian


    Yes, TIP 457 was one of the dark ages of the TCL community with the
    "debating down" culture. And at the end, we have no solution and a lot
    of frustrated people...
    I would love, if this gem would make it to the core, but the time of 9.0 release is now passed...

    Thank you,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 25 09:01:20 2024
    Am 25.06.2024 um 08:14 schrieb Christian Gollwitzer:
    Am 24.06.24 um 10:11 schrieb Mark Summerfield:
    I want to create a couple of procs with these usages:

    dialog::prepare ?-parent .? ?-modal true? window

    Here is another very simple argument parser: Use "dict merge".

    proc someprocwithargs {args} {
        set defaults {-parent . -modal false}
        set options [dict merge $defaults $args]
        if {[dict size $options] != [dict size $defaults]} {
            return -code error "Unknown option"
        }
        # now use the stuff in options
    }

    To extend by a mandatory argument is left as an exercise to the reader,
    you basically take off the last element from "args". It is advisable to
    do it this way, i.e. to make the mandatory argument positional, either
    in the beginning - then you can simple stuff it before "args" - or at
    the end. This way, an option can not be confused with a positional
    argument, and no "--" stuff is needed.

    There have also been LOTS of advanced implementations in pure Tcl around
    the discussion of TIP 457
    https://core.tcl-lang.org/tips/doc/trunk/tip/457.md

        Christian


    Great solution, Christian, I appreciate. I use that often, but the "dict
    size" trick is great.

    dialog::prepare ?-parent .? ?-modal true? window

    What magic Christian writes about "to the reader", withoput error checking:

    set window [lindex $args end]
    set args [lrange $args 0 end-1]

    Thanks,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to Harald Oehlmann on Tue Jun 25 07:23:59 2024
    On Tue, 25 Jun 2024 09:05:02 +0200, Harald Oehlmann wrote:

    Am 25.06.2024 um 08:14 schrieb Christian Gollwitzer:
    There have also been LOTS of advanced implementations in pure Tcl
    around the discussion of TIP 457
    https://core.tcl-lang.org/tips/doc/trunk/tip/457.md

        Christian


    Yes, TIP 457 was one of the dark ages of the TCL community with the
    "debating down" culture. And at the end, we have no solution and a lot
    of frustrated people...
    I would love, if this gem would make it to the core, but the time of 9.0 release is now passed...

    Thank you,
    Harald

    Hi Harald,

    Is there a stand-alone installable installation of the TIP-457 reference
    code that could be added in to my local Tcl/Tk 9.0b2 installation?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 25 09:26:21 2024
    Am 25.06.2024 um 09:23 schrieb Mark Summerfield:
    On Tue, 25 Jun 2024 09:05:02 +0200, Harald Oehlmann wrote:

    Am 25.06.2024 um 08:14 schrieb Christian Gollwitzer:
    There have also been LOTS of advanced implementations in pure Tcl
    around the discussion of TIP 457
    https://core.tcl-lang.org/tips/doc/trunk/tip/457.md

        Christian


    Yes, TIP 457 was one of the dark ages of the TCL community with the
    "debating down" culture. And at the end, we have no solution and a lot
    of frustrated people...
    I would love, if this gem would make it to the core, but the time of 9.0
    release is now passed...

    Thank you,
    Harald

    Hi Harald,

    Is there a stand-alone installable installation of the TIP-457 reference
    code that could be added in to my local Tcl/Tk 9.0b2 installation?

    I have no idea, sorry... If someone would try it, the battle will
    restart, so I don't think, this will work... TCL community is very very difficult...

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Mark Summerfield on Tue Jun 25 08:21:27 2024
    On 6/25/2024 12:01 AM, Mark Summerfield wrote:
    On Mon, 24 Jun 2024 08:13:09 -0500, Gerald Lester wrote:

    On 6/24/24 03:11, Mark Summerfield wrote:
    I want to create a couple of procs with these usages:

    dialog::prepare ?-parent .? ?-modal true? window

    I can't use the parse_args package because I don't know how to install
    it (and it has no INSTALL doc)

    I can see from the wiki that there seems to be a lot of different pure
    Tcl solutions, so I don't know which one to choose.

    I'm using Tcl/Tk 9.0b2.

    Look first to TclLib --
    https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/
    modules/tepam/tepam_introduction.md

    I had peeked at that but was put off by there being no 'examples' section. I'll have another look at it.

    Thanks also to the other repliers, but I want something 'standards' rather than ad hoc. I do find it surprising that it isn't part of Tcl itself.


    I too looked at tepam and also TIP 457 but found both to be impenetrable without some serious study, of which I was not motivated to expend. Maybe if Ashok were to write a chapter with his ability to simplify esp. with good examples.

    However, it seems to me that a somewhat simple solution for a "standard" might be a proc say, called processArgs and hand it an argument spec similar to what was given in the first posting, then it could parse the spec, in the manner of say, YACC with a
    bnf spec. Using [uplevel] it could create variables in the proc.

    So, for example, given:

    dialog::prepare ?-parent .? ?-modal true? window

    We have our proc,

    proc processArgs {args} {...}

    So, here args in this case might begin as:

    ?-parent window? ?-modal boolean? window window

    Then to make it easy for processArgs itself, add braces or quotes

    processArgs {?-parent window?} {?-modal boolean?} "window window"

    And to add default values for the optional arguments use =,

    processArgs {?-parent window=.?} {?-modal boolean=true?} "window window"

    And by using a [foreach] and [uplevel] with some simple parsing, processArgs would in this case produce the 3 variables, parent, modal, and window in the context of the calling procedure, like so:

    proc dialog::prepare {args} {
    processArgs {?-parent window=.?} {?-modal boolean=true?} "window window"
    ...
    }


    It could use () and ... to indicate some repeating arguments, where the result would be an array variable, with the (0) to indicate a required first argument, and () for all the optional ones to follow.

    "window(0) window" "?window() window...?"

    And support the obvious types: integer, text, window, boolean, real. Maybe some others.

    Simple on/off options with no value, that default to off if not used, like

    ?-optionOnly?

    And resist the temptation to make this too much more complicated.

    The fatal flaw I always see when beginning with something simple like this, and thinking maybe I'll write up a TIP is that after the Tcl community begins to warm up to the proposal, it grows and grows as people add their requests for their favorite
    features until it becomes a monster with so many options that it becomes impenetrable once again.

    Often it takes a single dedicated person to create an elegant solution and just build it without input from dozens of others. But that doesn't seem to be the way of Tcl.

    -et

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to [email protected] on Tue Jun 25 16:20:35 2024
    et99 <[email protected]> wrote:
    On 6/25/2024 12:01 AM, Mark Summerfield wrote:
    I had peeked at that but was put off by there being no 'examples'
    section. I'll have another look at it.

    Thanks also to the other repliers, but I want something 'standards'
    rather than ad hoc. I do find it surprising that it isn't part of
    Tcl itself.


    I too looked at tepam and also TIP 457 but found both to be
    impenetrable without some serious study, of which I was not motivated
    to expend. Maybe if Ashok were to write a chapter with his ability
    to simplify esp. with good examples.

    However, it seems to me that a somewhat simple solution for a
    "standard" might be a proc say, called processArgs and hand it an
    argument spec similar to what was given in the first posting, then it
    could parse the spec, in the manner of say, YACC with a bnf spec.
    Using [uplevel] it could create variables in the proc.

    There is also, in tcllib, the 'cmdline' package:

    https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/cmdline/cmdline.md

    Which provides an options parser that is very similar (although not
    100% identical) to the GNU C 'getopt' options parser. And the man page
    has an example.

    Quite a number of other tcllib modules use 'cmdline' for their options
    parsing, so it is 'reasonably standard' in that sense -- and being very
    similar to the gnulib C 'getopt' library function makes it much more
    'standards like' (assuming one considers C library functions to be
    'standard') than most.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ted Nolan @21:1/5 to [email protected] on Tue Jun 25 21:25:47 2024
    In article <v5fc9o$1nlts$[email protected]>, et99 <[email protected]> wrote: >On 6/25/2024 9:20 AM, Rich wrote:
    et99 <[email protected]> wrote:
    snip


    There is also, in tcllib, the 'cmdline' package:

    https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/cmdline/cmdline.md

    Which provides an options parser that is very similar (although not
    100% identical) to the GNU C 'getopt' options parser. And the man page
    has an example.

    It looks like a recipe for a unix command line, not so much a tcl command.


    Yes. I recently put together a number of Tcl command line programs
    using cmdline getopt into one Tcl program, keeping the parsing.

    It looked... really weird.

    (Love getopt for command line stuff though)
    --
    columbiaclosings.com
    What's not in Columbia anymore..

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Rich on Tue Jun 25 14:19:52 2024
    On 6/25/2024 9:20 AM, Rich wrote:
    et99 <[email protected]> wrote:
    snip


    There is also, in tcllib, the 'cmdline' package:

    https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/cmdline/cmdline.md

    Which provides an options parser that is very similar (although not
    100% identical) to the GNU C 'getopt' options parser. And the man page
    has an example.

    It looks like a recipe for a unix command line, not so much a tcl command.


    Quite a number of other tcllib modules use 'cmdline' for their options parsing, so it is 'reasonably standard' in that sense -- and being very similar to the gnulib C 'getopt' library function makes it much more 'standards like' (assuming one considers C library functions to be 'standard') than most.


    I suggested that one could "parse" a Tcl command spec a-la the manual's standard, because it should be familiar to all Tcl programmers, or at least those that RTM :)

    Also it was quite easy to build a working ad-hoc program using chatGPT from just such a spec. If it becomes so complex that it can't do it, then it's likely going to be too complex for humans as well.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to [email protected] on Tue Jun 25 22:21:12 2024
    et99 <[email protected]> wrote:
    On 6/25/2024 9:20 AM, Rich wrote:
    et99 <[email protected]> wrote:
    snip


    There is also, in tcllib, the 'cmdline' package:

    https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/cmdline/cmdline.md

    Which provides an options parser that is very similar (although not
    100% identical) to the GNU C 'getopt' options parser. And the man
    page has an example.

    It looks like a recipe for a unix command line, not so much a tcl command.

    That is likely its intent, but one can use it to parse the "args" list
    of a proc in the same way one can use it to parse the argv list of CLI
    options. Quite a few other tcllib modules use it for their "command
    arguments" parsing (all of which are not unix cli commands, but various
    Tcl procs).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to All on Wed Jun 26 07:36:19 2024
    In the end I used teapam. For example:

    package require tepam

    namespace eval dialog {}

    tepam::procedure {dialog prepare} {
    -named_arguments_first 0
    -args {
    {-modeless -type none}
    {-parent -default .}
    {window}
    }
    } {
    wm withdraw $window
    wm attributes $window -type dialog
    if {!$modeless} { wm transient $window $parent }
    }

    I also used it for show and hide functions so that 'dialog' is an ensemble command.

    It is a pity the docs lack egs but in the end I found it fairly easy to
    use.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Mark Summerfield on Wed Jun 26 16:29:50 2024
    Mark Summerfield <[email protected]> wrote:

    It is a pity the docs lack egs but in the end I found it fairly easy to
    use.

    The docs are a collabarative endeavor. Contribute an example as a
    patch and it will likely be included. Then you've helped the next
    person who comes along looking for examples.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to Rich on Thu Jun 27 05:36:10 2024
    On Wed, 26 Jun 2024 16:29:50 -0000 (UTC), Rich wrote:

    Mark Summerfield <[email protected]> wrote:

    It is a pity the docs lack egs but in the end I found it fairly easy to
    use.

    The docs are a collabarative endeavor. Contribute an example as a patch
    and it will likely be included. Then you've helped the next person who
    comes along looking for examples.

    I have often made small contributions to projects on github but I never do
    for sourceforge which I don't like.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Leitgeb@21:1/5 to Mark Summerfield on Thu Jun 27 15:59:55 2024
    Mark Summerfield <[email protected]> wrote:
    Is there a stand-alone installable installation of the TIP-457 reference
    code that could be added in to my local Tcl/Tk 9.0b2 installation?

    Not exactly reference code, but you may have a look at my
    pure-Tcl implementation of something "rather close to tip457"

    https://wiki.tcl-lang.org/page/TclImplForNamedArguments

    There are a few examples there, but those also cover some corner cases,
    so just look for the things you may actually need.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)