ATTENTION: PROJECT HAS MOVED.
Flexible Scheme objects with message passing and prototypes
- Version: 0.5
- Date: November 18, 2012
- Author: John Croisant <john+protolk at croisant dot net>
- Project: https://gitlab.com/jcroisant/protolk/
- License: BSD 2-Clause
Protolk provides flexible object oriented programming in Scheme, combining encapsulation and message passing a la Smalltalk and Ruby, with prototypal inheritance a la Self and JavaScript.
Protolk is not a new language or dialect. It offers a Scheme record type, and collection of procedures that can be seamlessly integrated with other Scheme code. Some optional reader extensions are also available, to add some syntax sugar for convenience.
Protolk is designed with four core principles in mind:
- Simplicity: Protolk’s object model is very simple: an object holds its own properties and methods, it inherits properties and methods from an (optional) base object, and it performs actions in response to messages. That’s all there is to it. However…
- Extensibility: … it’s easy to build complex and interesting behavior on top of that simple object model. You can extend, customize, or replace pretty much anything about Protolk, including much of the inheritance system!
- Flexibility: Objects can be modified in any way at any time. You don’t have to declare ahead of time what properties or methods an object will have, or redefine an entire class just to add a property or method to a single object.
- Encapsulation: Objects maintain a separation between their private state and their public interfaces. Properties are only (directly) read or written by the object itself. Methods are public by nature, but there are ways to implement private methods.
You currently need Chicken Scheme to use Protolk. After you have
installed Chicken, you can install the latest release of Protolk by
running chicken-install protolk
. Or, if you want the absolute latest
revision of Protolk, you can clone the git repository then run the
chicken-install
command from within the repository clone directory.
To use Protolk in your code:
(require-extension protolk
protolk-stdpob
protolk-syntax-send-brackets
protolk-syntax-own-prop-at)
When you compile the file, if you are using Protolk�