Namespace lfun::
- Description
Callback functions used to overload various builtin functions.
The functions can be grouped into a few sets:
Object initialization and destruction.
Unary operator overloading.
`~(), `!(), _values(), cast(), _sizeof(), _indices(), __hash()
Binary asymmetric operator overloading.
`+(), ``+(), `-(), ``-(), `&(), ``&(), `|(), ``|(), `^(), ``^(), `<<(), ``<<(), `>>(), ``>>(), `*(), ``*(), `/(), ``/(), `%(), ``%()
Binary symmetric operator overloading.
The optimizer will make assumptions about the relations between these functions.
Other binary operator overloading.
Overloading of other builtin functions.
_is_type(), _sprintf(), _m_delete(), _get_iterator(), _search()
- Note
Although these functions are called from outside the object they exist in, they will still be used even if they are declared
protected
. It is in fact recommended to declare themprotected
, since that will hinder them being used for other purposes.- See also
- Variable symbol
mixed
lfun::symbol
- Method create
void
lfun:create(zero
...args
)- Description
Object creation callback.
This function is called right after lfun::__INIT().
args are the arguments passed when the program was called.
- Note
In Pike 7.2 and later this function can be created implicitly by the compiler using the new syntax:
class Foo(int foo) { int bar; }
In the above case an implicit lfun::create() is created, and it's equivalent to:
class Foo { int foo; int bar; protected void create(int foo) { local::foo = foo; } }
- See also