Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tcloo how to call a hidden method

28 views
Skip to first unread message

aotto1968

unread,
Aug 27, 2022, 7:52:33 AM8/27/22
to
Hi,

a method from the parent-class can be hidden by current-class,. The problem is to
call a "hidden" method from outside (not from class-body)

→ to call a "hidden" method from class-body the "next" command is used but I want to call the method from outside

example:

$obj ToNameOfClass ; # call the latest "ToNameOfClass", but this is *not* wanted
$obj next ToNameOfClass ; # this is what I want, but this is *not* supported

In a traditional OO language the "obj" will be *cast* into the parent-class-instance and the
method will be called from this cast, but TCL has no cast etc

pseudocode:
set parent [$obj cast-to-parent]
$parent ToNameOfClass

BUT I like the *next* syntax better

parent: $obj next method
parent of parent: $obj next next method → etc


question: how can I call a *HIDDEN* method from "outside".


mfg

aotto1968

unread,
Aug 27, 2022, 8:45:13 AM8/27/22
to
addition.

In python all methods are static and a instance-method is a method with the *self* as *first* parameter

A possible call to a instance-method from the parent-class:

→ MkObjectC ToNameOfClass $obj

or more general

→ class method $instance

or as example

> $obj method ... (call the latest implementation of the method)
> class method $obj (call the implementation if the method provided by "class")

This should be possible to call a *specific* implementation (in this case the MkObjectC implementation) of the "ToNameOfClass"
method

mfg

0 new messages