ExLisp.CLOS (exlisp v0.1.2)

Copy Markdown

Common Lisp Object System (CLOS) implementation for ExLisp. Supports:

  • defclass (inheritance, CPL linearization, slot inheritance, initargs, initforms, accessors, readers, writers)
  • defgeneric and defmethod
  • Method qualifiers: :before, :after, :around, and primary methods
  • Standard Method Combination
  • Multi-argument method dispatch and (eql ...) specializers
  • call-next-method and next-method-p
  • make-instance, slot-value, (setf slot-value), slot-boundp, slot-makunbound, slot-exists-p
  • class-of, find-class, class-name, subclassp, subtypep integration

Summary

Functions

Applies a generic function using the Standard Method Combination.

Invokes the next method in the current method combination chain.

Computes the Class Precedence List (CPL) for a class using CLOS standard linearization.

Returns :t if a next method is available, nil otherwise.

Registers a generic function definition.

Registers a method on a generic function. qualifier can be nil (primary), :before, :after, :around. specializers is a list of type names or {:eql, value}. fun is (args -> result).

Functions

apply_generic(gen_name, args)

Applies a generic function using the Standard Method Combination.

call_next_method(custom_args \\ nil)

Invokes the next method in the current method combination chain.

class_name(name)

class_of(val)

compute_cpl(class_name, direct_supers)

Computes the Class Precedence List (CPL) for a class using CLOS standard linearization.

ensure_tables()

find_class(name)

generic_defined?(name)

get_cpl(class_name)

init_built_in_classes()

make_instance(class_name_or_obj, initargs \\ [])

Creates a new CLOS instance.

next_method_p()

Returns :t if a next method is available, nil otherwise.

register_class(name, supers, slots_spec, options \\ [])

Registers a CLOS class.

register_generic(name, lambda_list \\ [], options \\ [])

Registers a generic function definition.

register_method(name, qualifier, specializers, fun)

Registers a method on a generic function. qualifier can be nil (primary), :before, :after, :around. specializers is a list of type names or {:eql, value}. fun is (args -> result).

reset()

set_slot_value(arg1, slot_name, val)

slot_boundp(arg1, slot_name)

slot_exists_p(arg1, slot_name)

slot_makunbound(inst, slot_name)

slot_value(arg1, slot_name)

subclassp(sub, super)

type_matches_clos?(expected_type, arg)