Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

IOT trap -- core dumped


devel / comp.lang.tcl / Tcl8.7 with mymethod/callback but not with myvar

SubjectAuthor
o Tcl8.7 with mymethod/callback but not with myvarD Groth

1
Tcl8.7 with mymethod/callback but not with myvar

<5dfafd75-9189-48a5-821a-c8ce413574bdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=21583&group=comp.lang.tcl#21583

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:5c7:b0:3bf:b9d9:6759 with SMTP id d7-20020a05622a05c700b003bfb9d96759mr1300700qtb.8.1679488204884;
Wed, 22 Mar 2023 05:30:04 -0700 (PDT)
X-Received: by 2002:a81:bd51:0:b0:544:b8d8:339e with SMTP id
n17-20020a81bd51000000b00544b8d8339emr2991424ywk.5.1679488204613; Wed, 22 Mar
2023 05:30:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 22 Mar 2023 05:30:04 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=141.89.223.47; posting-account=l1SsogoAAADI9wGGep0j80-iEOPtae47
NNTP-Posting-Host: 141.89.223.47
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5dfafd75-9189-48a5-821a-c8ce413574bdn@googlegroups.com>
Subject: Tcl8.7 with mymethod/callback but not with myvar
From: tbgroth15@gmail.com (D Groth)
Injection-Date: Wed, 22 Mar 2023 12:30:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1764
 by: D Groth - Wed, 22 Mar 2023 12:30 UTC

Dear all,

I just looked around in the Tcl manual for 8.7. We have there mymethod (or callback) as in Snit for creating callbacks in the global scope for TclOO objects, but we do not have myvar as we have in Snit. I helped my self with:

proc ::oo::Helpers::myvar {varname} {
return [uplevel 1 {namespace qualifiers [namespace which my]}]::$varname
}

which does the job. Is myvar is missing in Tcl 8.7 by accident? Or what is an other approach to create a fully qualified variable for options like -variable or -textvariable in Tcl 8.7 within a TclOO class?

PS: As a reminder the code for mymethod in 8.6 was:
proc ::oo::Helpers::mymethod {method args} {
list [uplevel 1 {namespace which my}] $method {*}$args

}

Detlef


devel / comp.lang.tcl / Tcl8.7 with mymethod/callback but not with myvar

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor