Sujet : Re: OK, what looks better. The OLD tcl-oo or the NEW tcl-oo?
De : aotto1968 (at) *nospam* t-online.de (aotto1968)
Groupes : comp.lang.tclDate : 30. Jan 2025, 20:22:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vngjhp$336nb$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
Array versa Namespace
=====================
I struggled with whether myoo should be array-reference-based or namespace-reference-based.
After doing some research with the tclmyoo TCL-API and libmyoo C-API I switch to namespace-reference-based
The following reasons led to the switch to namespace-reference :
- With TclGetNamespaceFromObj from the tcl internal Int API, a very powerful tool is available for resolving a namespace.
- It has been confirmed that "namespace upvar NS my my" is significantly faster than "upvar NS::my my".
- To call a sub-method, the local-reference no longer needs to be resolved because the instance-namespace is always used
for the global namespace (::).
- An external-pointer can also be attached to the tcl internal Tcl_Namespace* pointer, which speeds up the
All-Language-Compiler (ALC) compiler massively.
- The code becomes much smaller and simpler by switching to the namespace-reference, so that I can proudly say that myoo is
by far the smallest Object-Oriented-Programming (OOP) in the world.
- Even with the tcl-only version, tclmyoo is faster than tcloo with over ten years of development work.
read more at:
http://thedev.nhi1.de/theLib/main/index.htm