classes/luafunction.pmc - Lua Function


LuaFunction extends Parrot Sub to provide a class with the behaviour of the Lua Function type.

Overloaded Methods ^

STRING *name()

Return the string "function".

STRING *get_string()

INTVAL get_bool()

In Lua, both nil and false make a condition false; any other values makes it true.

So return always true.

PMC *get_pmc_keyed (PMC *key)

Throws an exception.

void set_bool(INTVAL value)

void set_pmc_keyed (PMC *key, PMC *value)

Throws an exception.

PMC *neg (PMC *dest)

void i_neg()

Throws an exception.

PMC *logical_not(PMC *dest)

Common implementation (use get_bool & set_bool)

non-Vtable Methods ^

void add(PMC *value, PMC *dest)

void i_add (PMC *value)

void subtract(PMC *value, PMC *dest)

void i_substract (PMC *value)

void multiply(PMC *value, PMC *dest)

void i_multiply (PMC *value)

void divide(PMC *value, PMC *dest)

void i_divide (PMC *value)

PMC *modulus (PMC *value, PMC *dest)

void i_modulus (PMC *value)

PMC *pow (PMC *value, PMC *dest)

void i_pow (PMC *value)

PMC *concatenate (PMC *value, PMC *dest)

void i_concatenate (PMC *value)

Throws an exception.

INTVAL is_equal (PMC *value)

INTVAL cmp (PMC *value)

Specific Methods ^

PMC *get_metatable()

PMC *len()

PMC *rawequal (PMC *value)

PMC *tonumber()

PMC *tostring()


Francois Perrad