• Problem with namespace import

    From Cecil Westerhof@21:1/5 to All on Sun Jan 29 09:56:01 2023
    I have a script that I have been using for years. As far as I know I
    did not change it. In the part that creates the Tk stuff I do have:
    namespace import :::bindMultiple

    This gives:
    import pattern ":::bindMultiple" tries to import from namespace "" into itself while executing "namespace import :::bindMultiple"
    (file "/home/cecil/bin/teaTk.tcl" line 1)
    invoked from within "source ${scriptDir}/teaTk.tcl"
    (file "/home/cecil/bin/chooseTea.tcl" line 72)

    Has there changed something in tclsh?
    If the namespace import is wrong: what should it be?

    --
    Cecil Westerhof
    Senior Software Engineer
    LinkedIn: http://www.linkedin.com/in/cecilwesterhof

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Cecil Westerhof on Sun Jan 29 13:55:53 2023
    Cecil Westerhof <[email protected]> wrote:
    I have a script that I have been using for years. As far as I know I
    did not change it. In the part that creates the Tk stuff I do have:
    namespace import :::bindMultiple

    This gives:
    import pattern ":::bindMultiple" tries to import from namespace "" into itself while executing "namespace import :::bindMultiple"
    (file "/home/cecil/bin/teaTk.tcl" line 1)
    invoked from within "source ${scriptDir}/teaTk.tcl"
    (file "/home/cecil/bin/chooseTea.tcl" line 72)

    Has there changed something in tclsh?
    If the namespace import is wrong: what should it be?


    ::: is not a valid root namespace specifier (count the number of
    colons).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cecil Westerhof@21:1/5 to Rich on Sun Jan 29 18:32:19 2023
    Rich <[email protected]d> writes:

    Cecil Westerhof <[email protected]> wrote:
    I have a script that I have been using for years. As far as I know I
    did not change it. In the part that creates the Tk stuff I do have:
    namespace import :::bindMultiple

    This gives:
    import pattern ":::bindMultiple" tries to import from namespace "" into itself while executing "namespace import :::bindMultiple"
    (file "/home/cecil/bin/teaTk.tcl" line 1)
    invoked from within "source ${scriptDir}/teaTk.tcl"
    (file "/home/cecil/bin/chooseTea.tcl" line 72)

    Has there changed something in tclsh?
    If the namespace import is wrong: what should it be?


    ::: is not a valid root namespace specifier (count the number of
    colons).

    That was what I also thought. But changing it to two did not help.
    As far as I know the code has not been changed.
    It seems that it should be something like:
    namespace import PACKAGE::bindMultiple

    But until now I did not manage to find the correct package.
    (I must confess that I am not the most proficient searcher.)

    Does anyone know which package I should use?

    --
    Cecil Westerhof
    Senior Software Engineer
    LinkedIn: http://www.linkedin.com/in/cecilwesterhof

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Cecil Westerhof on Sun Jan 29 17:46:43 2023
    Cecil Westerhof <[email protected]> wrote:
    Rich <[email protected]d> writes:

    Cecil Westerhof <[email protected]> wrote:
    I have a script that I have been using for years. As far as I know I
    did not change it. In the part that creates the Tk stuff I do have:
    namespace import :::bindMultiple

    This gives:
    import pattern ":::bindMultiple" tries to import from namespace "" into itself while executing "namespace import :::bindMultiple"
    (file "/home/cecil/bin/teaTk.tcl" line 1)
    invoked from within "source ${scriptDir}/teaTk.tcl"
    (file "/home/cecil/bin/chooseTea.tcl" line 72)

    Has there changed something in tclsh?
    If the namespace import is wrong: what should it be?


    ::: is not a valid root namespace specifier (count the number of
    colons).

    That was what I also thought. But changing it to two did not help.
    As far as I know the code has not been changed.
    It seems that it should be something like:
    namespace import PACKAGE::bindMultiple

    But until now I did not manage to find the correct package.
    (I must confess that I am not the most proficient searcher.)

    Does anyone know which package I should use?

    A google search for "tcl bindMultiple" (and forcing google to not
    change it to "bind multiple" returned zero hits.

    Is this possibly your own custom namespace from some other bit of code
    you wrote?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cecil Westerhof@21:1/5 to Rich on Sun Jan 29 19:40:43 2023
    Rich <[email protected]d> writes:

    Cecil Westerhof <[email protected]> wrote:
    Rich <[email protected]d> writes:

    Cecil Westerhof <[email protected]> wrote:
    I have a script that I have been using for years. As far as I know I
    did not change it. In the part that creates the Tk stuff I do have:
    namespace import :::bindMultiple

    This gives:
    import pattern ":::bindMultiple" tries to import from namespace "" into itself while executing "namespace import :::bindMultiple"
    (file "/home/cecil/bin/teaTk.tcl" line 1)
    invoked from within "source ${scriptDir}/teaTk.tcl"
    (file "/home/cecil/bin/chooseTea.tcl" line 72)

    Has there changed something in tclsh?
    If the namespace import is wrong: what should it be?


    ::: is not a valid root namespace specifier (count the number of
    colons).

    That was what I also thought. But changing it to two did not help.
    As far as I know the code has not been changed.
    It seems that it should be something like:
    namespace import PACKAGE::bindMultiple

    But until now I did not manage to find the correct package.
    (I must confess that I am not the most proficient searcher.)

    Does anyone know which package I should use?

    A google search for "tcl bindMultiple" (and forcing google to not
    change it to "bind multiple" returned zero hits.

    Is this possibly your own custom namespace from some other bit of code
    you wrote?

    That was the problem. I wrote a set of proc's that I find very useful.
    So I needed tot do:
    namespace import ::dcblUtilities::bindMultiple

    The proc for people who like to know it:
    proc ::dcblUtilities::bindMultiple {tag sequences script} {
    foreach event ${sequences} {
    bind ${tag} <${event}> ${script}
    }
    }

    But why ::dcblUtilities::bindMultiple was changed into :::bindMultiple


    --
    Cecil Westerhof
    Senior Software Engineer
    LinkedIn: http://www.linkedin.com/in/cecilwesterhof

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Cecil Westerhof on Sun Jan 29 23:22:07 2023
    Cecil Westerhof <[email protected]> wrote:

    But why ::dcblUtilities::bindMultiple was changed into :::bindMultiple

    That looks like a search/replace gone wrong.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cecil Westerhof@21:1/5 to Rich on Mon Jan 30 07:55:46 2023
    Rich <[email protected]d> writes:

    Cecil Westerhof <[email protected]> wrote:

    But why ::dcblUtilities::bindMultiple was changed into :::bindMultiple

    That looks like a search/replace gone wrong.

    As far as I know I did not though that file for a long time. Maybe
    there where gremlins in the house. ;-)

    But problem solved. :-D

    --
    Cecil Westerhof
    Senior Software Engineer
    LinkedIn: http://www.linkedin.com/in/cecilwesterhof

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