What is the difference between
. = ..()
and
..()
for returning the parent proc in a proc?
Also, what is the actual function of these two? Does ..() simply return the proc of the parent_type, or will it look for other procs on the same type level?
~Polatrite~ Hopefully it made sense.
ID:136403
![]() Nov 7 2002, 1:37 pm
|
|
All DM functions implicitly return a value. That value is stored in the '.' variable This is null by default, but you can override it to return something else. These two functions are therefore identical:
So . is mainly useful as a shorthand to assign a return value ahead of time.
..() is a proc referring to the parent's version of the current function. So doing ..() will call the parent function. Doing . = ..() will call the parent function and set the return value of the current function to that of the call. Just think of it as two steps:
If the function ends there, this is just the same as: