Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"Not only is God dead, but just try to find a plumber on weekends." -- Woody Allen


devel / comp.lang.tcl / tcloo howto call a superclass "new" ?

SubjectAuthor
o tcloo howto call a superclass "new" ?aotto1968

1
tcloo howto call a superclass "new" ?

<uv35j6$5q6t$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=13638&group=comp.lang.tcl#13638

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: tcloo howto call a superclass "new" ?
Date: Tue, 9 Apr 2024 12:34:12 +0200
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <uv35j6$5q6t$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 09 Apr 2024 10:34:14 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cf48e5c1f2de4d9a3e55e08e7f1d8894";
logging-data="190685"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XUCwwmiDldDMS8yKfuu0Jmg6MUCL55Yg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:cClAGoiQ23s+5iZvivkkMp/Ge38=
Content-Language: en-US
 by: aotto1968 - Tue, 9 Apr 2024 10:34 UTC

Hi, I use tcl8.6.12 and the "superclass new" is not called → why

oo::class create MkObjectRpc {
superclass oo::class
# root
variable hdl
}

oo::class create Sq3LiteRpc {
superclass MkObjectRpc
variable hdl
}

# superclass "new"
oo::define MkObjectRpc self method new { rpc args } {
CUM
set cls [self class]
# call: Sq3Litenew
if {[lindex $args 0] eq {-hdl}} {
set mqHdl [lindex $args 1]
} else {
set mqHdl [[info obj namespace $cls]::my CTOR $rpc {*}$args]
}
next $rpc $mqHdl
}

# class "new"
oo::define Sq3LiteRpc self method new { rpc args } {
CUM
cmd self call
# call: Sq3Litenew
next $rpc {*}$args → expect to call "MkObjectRpc self method new"
}

test:

> Sq3LiteRpc new $rpc :memory:

"Sq3LiteRpc self method new" is called → OK

:Sq3LiteRpc::new -> CUM -> rpc<::oo::Obj41> , args<:memory:>
[self call] = {{method new object method} {method new ::oo::class {core method: "new"}}} 0

BUT !! " MkObjectRpc self method new" is NOT called ?? → why ?

the same code with: "nextto MkObjectRpc $rpc {*}$args" in "Sq3LiteRpc self method new" create

method has no non-filter implementation by "MkObjectRpc"
while executing
"nextto MkObjectRpc $rpc {*}$args"
(object "::Sq3LiteRpc" method "new" line 5)
invoked from within
"Sq3LiteRpc new $FH($F) :memory: "
("uplevel" body line 1)
invoked from within
"uplevel 1 $script"

mfg ao.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor