NAME ^

classes/sub.pmc - Subroutine

DESCRIPTION ^

These are the vtable functions for the Sub (subroutine) base class

Functions ^

void init()

Initializes the subroutine.

void destroy()

Destroys the subroutine.

STRING *get_string()

Returns the name of the subroutine.

void set_string_native(STRING *subname)

Sets the name of the subroutine.

void set_pointer(void *value)

Sets the pointer to the actual subroutine.

void *get_pointer()

Returns the pointer to the actual subroutine.

INTVAL get_integer_keyed(PMC *key)

This just unconditionally returns the start of bytecode. It's wrong, wrong, wrong, *WRONG*. And there's no other good way, so it's here for now. -DRS

INTVAL defined()

INTVAL get_bool()

Returns whether the subroutine is defined.

void *invoke(void *next)

Invokes the subroutine.

PMC *clone()

Creates and returns a clone of the subroutine.

void mark()

Marks the continuation as live.

void set_same(PMC *value)

Sets the subroutine to *value.

INTVAL is_equal(PMC *value)

Returns whether the two subroutines are equal.

void visit(visit_info *info)

This is used by freeze/thaw to visit the contents of the sub.

void freeze(visit_info *info)

Archives the subroutine.

void thaw(visit_info *info)

Unarchives the subroutine.

void thawfinish(visit_info *info)

Called after the subroutine as been unarchived.

METHODS ^

METHOD PMC *get_name_space()

Return the name_space PMC or Undef. The name_space PMC is either a String PMC or a Key PMC for a nested name_space.

HISTORY ^

Initial version by Melvin on 2002/06/6.


parrot