Tcl 9.0 and modtcl #1048

Open
opened 2026-10-05 05:00:25 +02:00 by adam · 3 comments
Owner

The tcl 9.0 is getting mature and the latest release at this time of writing is 9.0b3.

When znc is compiled with --enable-tcl, the configure checks for the tclsh and I have tcl9.0b3 installed.

I launch znc, use loadmod modtcl /usr/local/share/znc/modtcl/motcl.tcl and the modtcl gets loaded.
Then I type /query *modtcl.tcl and type rehash.

Apparently everything looks ok until I type binds. I get an error. Even if I use bind time - "time.." command.

The namespace of tcl 9.0 b3 apparently needs everything well declared.

According to migrate tool found here on github, gets me 4 items that need to be changed in binds.tcl file.

 └─$ tclsh migrate.tcl check /usr/local/share/znc/modtcl/binds.tcl
Line  37: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS]
Line  38: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS]
Line  45: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS]
Line  45: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS]

This is what needs to be changed:

line37                if {[lsearch $::Binds::List "$type $flags [list $cmd] 0 [list $procname]"] == -1} {
line38                        lappend ::Binds::List "$type $flags [list $cmd] 0 [list $procname]"
                }
                return $cmd
        }

        proc Del {type flags cmd procname} {
                if {[set match [lsearch [binds] "$type $flags $cmd 0 $procname"]] != -1 || [set match [lsearch [binds] "$type $flags {${cmd}} 0 $procname"]] != -1} {
line45                        set ::Binds::List [lreplace $::Binds::List $match $match]

So the binds.tcl needs 4 :: added to it. And it will work with 8.611+, 8.7a5, 9.0b2+. You can close this issue. Unless someone has something to add.

I also opened a page from sourceforge, someone complained about clock having a bug. I ran the code and got no error.

The tcl 9.0 is getting mature and the latest release at this time of writing is 9.0b3. When znc is compiled with --enable-tcl, the configure checks for the tclsh and I have tcl9.0b3 installed. I launch znc, use loadmod modtcl /usr/local/share/znc/modtcl/motcl.tcl and the modtcl gets loaded. Then I type /query *modtcl.tcl and type rehash. Apparently everything looks ok until I type binds. I get an error. Even if I use bind time - "time.." command. The namespace of tcl 9.0 b3 apparently needs everything well declared. According to migrate tool found here on github, gets me 4 items that need to be changed in binds.tcl file. ``` └─$ tclsh migrate.tcl check /usr/local/share/znc/modtcl/binds.tcl Line 37: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS] Line 38: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS] Line 45: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS] Line 45: W Variable Binds::List maps to possibly non-existent child namespace ::Binds::Binds. [RELATIVENS] ``` This is what needs to be changed: ``` line37 if {[lsearch $::Binds::List "$type $flags [list $cmd] 0 [list $procname]"] == -1} { line38 lappend ::Binds::List "$type $flags [list $cmd] 0 [list $procname]" } return $cmd } proc Del {type flags cmd procname} { if {[set match [lsearch [binds] "$type $flags $cmd 0 $procname"]] != -1 || [set match [lsearch [binds] "$type $flags {${cmd}} 0 $procname"]] != -1} { line45 set ::Binds::List [lreplace $::Binds::List $match $match] ``` So the binds.tcl needs 4 :: added to it. And it will work with 8.611+, 8.7a5, 9.0b2+. You can close this issue. Unless someone has something to add. I also opened a page from sourceforge, someone complained about clock having a bug. I ran the code and got no error. <!-- github-sync-id:2497127027 -->
Author
Owner

please open PR

please open PR <!-- github-comment-id:2413703430 -->
Author
Owner

What's a PR?

What's a PR? <!-- github-comment-id:2414808211 -->
Author
Owner

pull request, here in github

pull request, here in github <!-- github-comment-id:2414810712 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#1048