• Re: Invalid command name ""

    From Jayashree Peluri@21:1/5 to Michael A. Cleverly on Mon Nov 7 19:40:25 2022
    On Saturday, July 30, 2005 at 9:02:07 AM UTC+8, Michael A. Cleverly wrote:
    On Fri, 29 Jul 2005, Aric Bills wrote:
    By the way, it is possible to define a Tcl procedure whose name is the empty
    string. Probably not a good idea,
    I use this idiom with tdom fairly regularly. It allows me to write
    something like:
    [[$node selectNodes $xpath] someMethod]
    where $xpath is an xpath expression that might return 0 or 1 nodes. To
    avoid having to explicitly deal with the case where no nodes would be returned I define:
    proc "" args {}
    Michael

    I tried using the proc "" args {}
    Now I don't see any error, but this function is breaking the flow of my program. Should I place any statment that continues the execution? I tried return "none" but of no use.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Jayashree Peluri on Tue Nov 8 03:48:51 2022
    Jayashree Peluri <[email protected]> wrote:
    On Saturday, July 30, 2005 at 9:02:07 AM UTC+8, Michael A. Cleverly wrote:
    On Fri, 29 Jul 2005, Aric Bills wrote:
    By the way, it is possible to define a Tcl procedure whose name is the empty
    string. Probably not a good idea,
    I use this idiom with tdom fairly regularly. It allows me to write
    something like:
    [[$node selectNodes $xpath] someMethod]
    where $xpath is an xpath expression that might return 0 or 1 nodes. To
    avoid having to explicitly deal with the case where no nodes would be
    returned I define:
    proc "" args {}
    Michael

    I tried using the proc "" args {}
    Now I don't see any error, but this function is breaking the flow of
    my program. Should I place any statment that continues the
    execution? I tried return "none" but of no use.

    Wow, resurrecting a 17 year old thread.....

    Please explain how "this function is breaking the flow of my program".
    That statement makes no sense.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jayashree Peluri@21:1/5 to Rich on Mon Nov 7 22:05:59 2022
    On Tuesday, November 8, 2022 at 11:48:56 AM UTC+8, Rich wrote:
    Jayashree Peluri <[email protected]> wrote:
    On Saturday, July 30, 2005 at 9:02:07 AM UTC+8, Michael A. Cleverly wrote:
    On Fri, 29 Jul 2005, Aric Bills wrote:
    By the way, it is possible to define a Tcl procedure whose name is the empty
    string. Probably not a good idea,
    I use this idiom with tdom fairly regularly. It allows me to write
    something like:
    [[$node selectNodes $xpath] someMethod]
    where $xpath is an xpath expression that might return 0 or 1 nodes. To
    avoid having to explicitly deal with the case where no nodes would be
    returned I define:
    proc "" args {}
    Michael

    I tried using the proc "" args {}
    Now I don't see any error, but this function is breaking the flow of
    my program. Should I place any statment that continues the
    execution? I tried return "none" but of no use.
    Wow, resurrecting a 17 year old thread.....

    Please explain how "this function is breaking the flow of my program".
    That statement makes no sense.
    Sorry for waking up the dead 😅 Looks like the program restarted because of another issue. Resolved it now!
    I confirm this 'proc "" args {} ' is working wonders! :) Thanks for prompt reply making me reassess the error!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From heinrichmartin@21:1/5 to shree on Mon Nov 7 23:12:26 2022
    On Tuesday, November 8, 2022 at 7:06:02 AM UTC+1, shree wrote:
    On Tuesday, November 8, 2022 at 11:48:56 AM UTC+8, Rich wrote:
    Jayashree wrote:
    On Saturday, July 30, 2005 at 9:02:07 AM UTC+8, Michael A. Cleverly wrote:
    On Fri, 29 Jul 2005, Aric Bills wrote:
    By the way, it is possible to define a Tcl procedure whose name is the empty
    string. Probably not a good idea,
    I use this idiom with tdom fairly regularly. It allows me to write
    something like:
    [[$node selectNodes $xpath] someMethod]
    where $xpath is an xpath expression that might return 0 or 1 nodes. To >> avoid having to explicitly deal with the case where no nodes would be >> returned I define:
    proc "" args {}
    Michael

    I tried using the proc "" args {}
    Now I don't see any error, but this function is breaking the flow of
    my program. Should I place any statment that continues the
    execution? I tried return "none" but of no use.
    Wow, resurrecting a 17 year old thread.....

    Please explain how "this function is breaking the flow of my program". That statement makes no sense.
    Sorry for waking up the dead 😅 Looks like the program restarted because of another issue. Resolved it now!
    I confirm this 'proc "" args {} ' is working wonders! :) Thanks for prompt reply making me reassess the error!

    Imo, the current level of divine support is unhealthy - you want more or less of it, depending on your belie...ehm requirements.

    Less wonders: You are maybe covering an issue, and you are not even logging it. Is "do nothing" an expected result of transform_line?
    More wonders: If transform_line may return nothing (or a command with args), then you actually want <code>{*}[transform_line ...]</code> in modern Tcl.

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