[closer-devel] Layered function troubles

Nick Bourner nickb42 at gmail.com
Mon Feb 20 13:52:07 UTC 2006


Hi all,

I'm having some troubles getting started with layered functions in ContextL
- I keep getting undefined-function errors when I try to use a layered
function, which I'd expect if I wasn't making the appropriate layer active.
Transcript of a test session shown below. Can someone please tell me what
blindingly stupid mistake I'm making?

BTW I'm using sbcl 0.9.8 on OS X, but I get something similar for OpenMCL as
well.


CL-USER> (require 'contextl)
; loading system definition from /usr/local/lib/sbcl/systems/lw-compat.asdinto
; #<PACKAGE "ASDF1183">
; registering #<SYSTEM #:LW-COMPAT {10E6CB31}> as LW-COMPAT
; loading system definition from /usr/local/lib/sbcl/systems/closer-mop.asd
; into #<PACKAGE "ASDF1185">
; registering #<SYSTEM #:CLOSER-MOP {404E9771}> as CLOSER-MOP
NIL
CL-USER> (use-package :contextl)
T
CL-USER> (deflayer foo-layer ())
#<CONTEXTL::LAYER-CLASS LAYER-CLASS-DEFINERS::|COMMON-LISP-USER::FOO-LAYER|>
CL-USER> (defclass bar () ())
#<STANDARD-CLASS BAR>
CL-USER> (define-layered-method baz :in-layer foo-layer ((obj bar))
                (format t "~&baz primary :in-layer foo-layer~%"))
#<STANDARD-METHOD LAYERED-FUNCTION-DEFINERS::|COMMON-LISP-USER::BAZ|
(LAYER-CLASS-DEFINERS::|COMMON-LISP-USER::FOO-LAYER|
                                                                      BAR)
{40513681}>
CL-USER> (defvar *b* (make-instance 'bar))
*B*
CL-USER> (with-active-layers (foo-layer)
       (baz *b*))
; in: LAMBDA NIL
;     (BAZ *B*)
;
; caught STYLE-WARNING:
;   undefined function: BAZ

;
; caught STYLE-WARNING:
;   This function is undefined:
;     BAZ
;
; compilation unit finished
;   caught 2 STYLE-WARNING conditions
; Evaluation aborted
CL-USER>



Thanks,
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/closer-devel/attachments/20060220/2c47193b/attachment.html>


More information about the closer-devel mailing list