[DGD] call_other() and static functions
Petter Nyström
md1pette at mdstud.chalmers.se
Mon Nov 28 21:53:01 CET 2005
As I have understood things, call_other() is the only way to call a
function. Correct?
To write foo->bar() is just syntactic sugar for call_other(foo, "bar") .
So I then assume that just bar() would be syntactic sugar for
call_other(this_object(), "bar") ?
My documentation (which could be outdated) tells me that static means "The
function can only be called from within the same object," which I think I
am doing. I am running DGD 1.2.112.
Thanks,
Jimorie
On Mon, 28 Nov 2005, Noah Gibbs wrote:
> The static-ness of the function might be the problem. I know you can't
> call_other() static functions on other objects. I don't remember if you can on
> yourself.
>
> --- Petter Nyström <md1pette at mdstud.chalmers.se> wrote:
>
>> Hello!
>>
>> I sit a bit puzzled here, supposing I am missing something but can't
>> figure out what. The problem I have is that a call on the form:
>>
>> call_other(this_object(), "trim", " foo ");
>>
>> is returning nil. (It never gets called). I make this call from my auto
>> program, and the trim() function is defined as:
>>
>> static nomask string trim (string str) { ... }
>>
>> also in the auto program. Reading the documentation I don't see why this
>> shouldn't work. Am I misunderstanding something? Or must perhaps something
>> else I do be wrong? Removing the static modifier from the trim() function
>> solves the problem, but I rather liked having most functions in the auto
>> object being static.
>>
>> If anyone's got a clue, please let me know. I might be missing something
>> obvious.
>>
>> Cheers,
>>
>> Jimorie
>> __________________________________________
>> http://mail.dworkin.nl/mailman/listinfo/dgd
>>
>
>
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
> __________________________________________
> http://mail.dworkin.nl/mailman/listinfo/dgd
>
More information about the DGD
mailing list