Skip to content

Advanced Customization

jacius edited this page Nov 24, 2012 · 1 revision

Introduction

Protolk's object system is extremely flexible. Many things about pobs can be customized, even on the level of an individual pob or a hierarchy of pobs. Some of the behaviors you can change are:

  • How a pob looks up props and methods.
  • How a pob receives and processes messages.
  • How a pob handles missing methods.
  • How a pob finds and invokes super methods.
  • How pob inheritance/ancestry works.
  • How a pob initializes derived pobs.
  • How a pob is printed as text.

If you want to do this sort of advanced customization, there are some key parts of the system you will want to change:

  • The pob's prop-resolver and method-resolver procedures.
  • The pob's _receive and _method-missing internal methods.
  • The pob's ancestors and has-ancestor? methods.*
  • The pob's derive method.*
  • The pob's _display internal method.

* These method names are just for consistency with stdpob. Feel free to come up with other method names or signatures to fit your custom behavior, especially if you don't derive from stdpob.

Primitive API

The protolk-primitives module contains the "primitive" API, i.e. the low level procedures that underly the high level Protolk API that most users will use. The primitives API is provided to make advanced customization easier. See Primitive API for details.

Prop and Method Resolvers

(Not yet written.)

Ancestry

(Not yet written.)

Receiving Messages / Missing Methods

(Not yet written.)

Super Methods

(Not yet written.)

Printing

(Not yet written.)