• =?UTF-8?Q?tcl_oo_and_forward_=E2=86=92_nor_working_as_expected?=

    From Andreas Otto@21:1/5 to All on Wed Aug 10 00:58:32 2022
    Question, why is that not working?

    _________________________________________
    oo::class create LcConfigC_Rpc {
    variable hdl

    constructor {rpcSlot} {
    oo::objdefine [self] forward rpc $rpcSlot send
    puts "object methods = [info object methods [self] -all]"
    puts "forward method: rpc = [info object forward [self] rpc]"
    puts "test: rpcS send... = [rpcS send "W" LcLogConfigFormatE "C@C" FORMAT_DEFAULT]"
    set hdl [rpc LcConfigCreate "@C"]
    }
    }

    # 1. create "rpcS"
    ConfigClient create rpcS $rpcF {*}$argv
    # 2. wanna create "cfg"
    LcConfigC_Rpc create cfg rpcS
    ===========================================
    results:
    1. "rpc" is a method
    object methods = destroy getOptions rpc setIncludeFuncService
    2. "rpc" is a forward
    forward method: rpc = rpcS send
    3. calling "rpcS send..." (the original) is possible
    test: rpcS send... = DEFAULT
    4. calling "rpc" the forward id NOT possible
    invalid command name "rpc"
    while executing
    "rpc LcConfigCreate "@C""
    (class "::LcConfigC_Rpc" constructor line 6)
    invoked from within
    "LcConfigC_Rpc create cfg rpcS"……

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gerald Lester@21:1/5 to Andreas Otto on Wed Aug 10 09:22:06 2022
    On 8/10/22 02:58, Andreas Otto wrote:
    Question, why is that not working?

    _________________________________________
    oo::class create LcConfigC_Rpc {
    variable hdl

    constructor {rpcSlot} {
    oo::objdefine [self] forward rpc $rpcSlot send
    puts "object methods = [info object methods [self] -all]"
    puts "forward method: rpc = [info object forward [self] rpc]"
    puts "test: rpcS send... = [rpcS send "W" LcLogConfigFormatE "C@C" FORMAT_DEFAULT]"
    set hdl [rpc LcConfigCreate "@C"]
    }
    }

    # 1. create "rpcS"
    ConfigClient create rpcS $rpcF {*}$argv
    # 2. wanna create "cfg"
    LcConfigC_Rpc create cfg rpcS
    ===========================================
    results:
    1. "rpc" is a method
    object methods = destroy getOptions rpc setIncludeFuncService
    2. "rpc" is a forward
    forward method: rpc = rpcS send
    3. calling "rpcS send..." (the original) is possible
    test: rpcS send... = DEFAULT
    4. calling "rpc" the forward id NOT possible
    invalid command name "rpc"
    while executing
    "rpc LcConfigCreate "@C""
    (class "::LcConfigC_Rpc" constructor line 6)
    invoked from within
    "LcConfigC_Rpc create cfg rpcS"……

    That is what I would expect to see, unless you have a command rpc
    defined somewhere.

    Per chance did you mean:
    set hdl [my rpc LcConfigCreate "@C"]


    --
    +----------------------------------------------------------------------+
    | Gerald W. Lester, President, KNG Consulting LLC |
    | Email: [email protected] | +----------------------------------------------------------------------+

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Otto@21:1/5 to Gerald Lester on Thu Aug 11 00:45:35 2022
    I found the problem, I forget the "my" in front of the "rpc".

    Gerald Lester schrieb am Mittwoch, 10. August 2022 um 16:22:19 UTC+2:
    On 8/10/22 02:58, Andreas Otto wrote:
    Question, why is that not working?

    _________________________________________
    oo::class create LcConfigC_Rpc {
    ...
    "LcConfigC_Rpc create cfg rpcS"……
    That is what I would expect to see, unless you have a command rpc
    defined somewhere.

    Per chance did you mean:
    set hdl [my rpc LcConfigCreate "@C"]


    --
    +----------------------------------------------------------------------+
    | Gerald W. Lester, President, KNG Consulting LLC |
    | Email: [email protected] | +----------------------------------------------------------------------+

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