Supported features:
- Encapsulation
- Inheritance
- Polymorphism
instance->_->method(instance, arg1, arg2, ...);
Examples:
array->_->len(array);
hash->_->set(hash, key, value);
Initialize Object class
o_init_object_class();
Usage
-
Create an instance from
Objectclass.o_object_t * foo = OObject.new(); -
Call
class_namemethod of foo.puts(foo->_->class_name(foo)); // => OObject -
Delete this instance.
foo->_->delete(foo);
Initialize String class
o_init_string_class();
Usage
-
Create an instance from
Stringclass.o_string_t * bar = OString.new("bar"); -
Call
class_name,string, andlenmethods of foo.puts(bar->_->class_name(bar)); // => OString puts(bar->_->string(bar)); // => bar printf("%zu", bar->_->len(bar)); // => 3 -
Delete this instance.
bar->_->delete(bar);
Build libyooc.a and tests
make
Run coverage
make yooc_coverage