From: Pascal Costanza
Subject: AspectL 0.5 released
Date: 
Message-ID: <c9qepp$320$1@newsreader2.netcologne.de>
Hi,

The first public release of AspectL is available at 
http://www.common-lisp.net/project/aspectl/

It provides generic pointcuts, destructive mixins, a generalized dletf 
framework, special classes with slots that can be rebound via dletf, and 
special generic functions whose sets of methods can be modified with 
dynamic scope.

Currently, only LispWorks is supported (tested on Mac OS X), since this 
extension relies heavily on the correct behavior of the CLOS MOP. I have 
tried to make AspectL run on Allegro CL, SBCL and OpenMCL, but I haven't 
succeeded yet.

To give you a taste of what's possible with AspectL, see the following 
transcript of a session. For more information, see the website and the 
documentation that comes with the source files.

CL-USER 1 > (in-package #:al-user)
#<The ASPECTL-USER package, 0/16 internal, 0/16 external>

AL-USER 2 > (defclass person ()
               ((name :accessor person-name :initarg :name))
               (:metaclass special-class))
#<SPECIAL-CLASS PERSON 100D417B>

AL-USER 3 > (defvar *p* (make-instance 'person :name "Dr. Jekyll"))
*P*

AL-USER 4 > (person-name *p*)
"Dr. Jekyll"

AL-USER 5 > (dletf (((person-name *p*) "Mr. Hide"))
               (person-name *p*))

Error: Attempt at rebinding a non-special-place.
   1 (continue) Retry assertion.
   2 (abort) Return to level 0.
   3 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other 
options

AL-USER 6 : 1 > ; Oops, I have forgotten to make the slot NAME a special 
slot. Let's fix that.
                 (slot-set :special t :for-class 'person :for-slot 'name)
#<SPECIAL-CLASS PERSON 100D417B>

AL-USER 7 : 1 > :c
"Mr. Hide"

AL-USER 8 > (person-name *p*)
"Dr. Jekyll"

AL-USER 9 > (defgeneric print-person-list (person-list)
               (:method (person-list)
                (mapc #'print-person person-list)))
#<STANDARD-GENERIC-FUNCTION PRINT-PERSON-LIST 100960B2>

AL-USER 10 > (defgeneric print-person (person)
                (:generic-function-class special-generic-function)
                (:method ((scope t) person)
                 (print (person-name person))))
#<SPECIAL-GENERIC-FUNCTION PRINT-PERSON 10093AEA>

AL-USER 11 > (defmethod print-person-list :around (person-list)
                (with-special-generic-function-scope (print-person)
                  (define-special-method print-person :before
                    ((scope dynamic) person)
                    (print "This person is part of a person list."))
                  (call-next-method)))
#<STANDARD-METHOD PRINT-PERSON-LIST (:AROUND) (T) 1008E9AB>

AL-USER 12 > (dletf (((person-name *p*) "Mr. Hide"))
                (print-person-list (list *p*)))

"This person is part of a person list."
"Mr. Hide"
(#<PERSON 110043F7>)



Pascal

-- 
1st European Lisp and Scheme Workshop
June 13 - Oslo, Norway - co-located with ECOOP 2004
http://www.cs.uni-bonn.de/~costanza/lisp-ecoop/