[Kde-bindings] Re: Smoke: On classes and objects
Luca Fascione
lukes at wetafx.co.nz
Mon Apr 4 03:32:21 UTC 2005
Ashley Winters wrote:
>--- Luca Fascione <lukes at wetafx.co.nz> wrote:
>
>
>>TCL doesn't have types and so doesn't have type control.
>>
>>
>
>Well, you're going to want to use the Tcl_Obj system to efficiently use
>Smoke in Tcl. For each argument passed to a function, you need to
>determine whether it's a list/dict aggregate type, a Qt object, or a
>simple type (any of string/int/float). Trying to figure that out
>automagically from everything's string representation would be hard.
>
>
Indeed, I was just stressing that TCL is the possibily the most weakly
typed language around... And anyhow data conversion should be driven by
the prototype for the particular method... or not? I mean being able to
resolve this in a TCL binding is going to be nasty. Suppose you are in
the following:
Situation:
- suppose you have a method:
void someClass::myMethod (int count, char* string) { /* yadda yadda
yadda */ }
- which is then overloaded by another method:
void someClass::myMethod (char* behaviour, int number) { /* re-yadda
yadda yadda */ }
- it would appear natural to express this in TCL as
someClass myMethod value1 value2
Now, suppose that for some reason the actual call is
someClass myMethod 2 123
How do you distinguish which function to call?
Man this is nasty... I strongly doubt there is any way to solve this...
Any clues, anybody?
Lukes
--
Luca Fascione
Pipeline Engineer - Weta Digital
+644 388 9307 (x4702) / +64 21 0764 862
More information about the Kde-bindings
mailing list