Common Lisp Package: MESSAGE-OO

README:

Message OO

This package gives you the great opportunity of real object-oriented programming.

For example, you may write

(use-package :message-oo)  
 
(defmessage list (:add item) (append list (list item)))  
(defmessage list (:map func) (mapcar func list))  
(defmessage list (:reduce func) (reduce func list))  
(defmessage number (:+ number2 &rest numbers)  
   (apply '+ number number2 numbers))  
 
(@ nil  
   (:add 1)  
   (:add 2)  
   (:add 3)  
   (:map (@ '(:+ 3) :fn))  
   (reduce #'+)) => 15 

You may think of last command as nil.add(1).add(2).add(3).map(..).reduce(...)

Every next step is applied to the result of previous as in UNIX shell pipeline.

Enjoy!

FUNCTION

Private

METHOD-NAME (MESSAGE-LIST)

(:add item) -> message-oo.mangle:|ADD:| (:add item :at pos) -> message-oo.mangle:|ADD:AT:| :add -> message-oo.mangle:add (:add item &rest rest) -> message-oo.mangle:|ADD::| (:add item :at pos &rest rest) -> message-oo.mangle:|ADD:AT::|

Undocumented

FIND-MESSAGE (MESSAGE)

METHOD-PARAMS (MESSAGE-LIST)

MACRO

Public

@ (OBJECT MESSAGE &REST MORE-MESSAGES)

Enables message pipelines (@ l (:map (lambda (x) (process x)))) == (mapcar ...) (@ l (:map func) (:reduce #'+)) == (reduce (mapcar ..))

DEFMESSAGE (CLASS-LIST MESSAGE-LIST &BODY BODY)

It is smalltalk-like: (defmessage container (:add item :after old-item) (container-add-after container item old-item))

VARIABLE

Private

Undocumented

+MANGLE+

CONDITION

Private

Undocumented

BAD-MESSAGE