Project Lucy has retired. For details please refer to its Attic page.
Clownfish::Obj – C API Documentation
Apache Lucy™

Clownfish::Obj

parcel Clownfish
class variable CFISH_OBJ
struct symbol cfish_Obj
class nickname cfish_Obj
header file Clownfish/Obj.h

Name

Clownfish::Obj – Base class for all objects.

Functions

init
cfish_Obj*
cfish_Obj_init(
    cfish_Obj *self
);

Abstract initializer.

get_class
cfish_Class*
cfish_Obj_get_class(
    cfish_Obj *self
);

Return the object’s Class.

get_class_name
cfish_String*
cfish_Obj_get_class_name(
    cfish_Obj *self
);

Return the name of the class that the object belongs to.

is_a
bool
cfish_Obj_is_a(
    cfish_Obj *self,
    cfish_Class *ancestor
);

Indicate whether the object is a descendent of ancestor.

Methods

Clone (abstract)
cfish_Obj* // incremented
cfish_Obj_Clone(
    cfish_Obj *self
);

Return a clone of the object.

Equals
bool
cfish_Obj_Equals(
    cfish_Obj *self,
    cfish_Obj *other
);

Indicate whether two objects are the same. By default, compares the memory address.

other

Another Obj.

Compare_To (abstract)
int32_t
cfish_Obj_Compare_To(
    cfish_Obj *self,
    cfish_Obj *other
);

Indicate whether one object is less than, equal to, or greater than another.

other

Another Obj.

Returns: 0 if the objects are equal, a negative number if self is less than other, and a positive number if self is greater than other.

To_String
cfish_String* // incremented
cfish_Obj_To_String(
    cfish_Obj *self
);

Generic stringification: “ClassName@hex_mem_address”.