Hi all,<br><br>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?
<br><br>BTW I'm using sbcl 0.9.8 on OS X, but I get something similar for OpenMCL as well.<br><br><br>CL-USER> (require 'contextl)<br>; loading system definition from /usr/local/lib/sbcl/systems/lw-compat.asd into<br>; #<PACKAGE "ASDF1183">
<br>; registering #<SYSTEM #:LW-COMPAT {10E6CB31}> as LW-COMPAT<br>; loading system definition from /usr/local/lib/sbcl/systems/closer-mop.asd<br>; into #<PACKAGE "ASDF1185"><br>; registering #<SYSTEM #:CLOSER-MOP {404E9771}> as CLOSER-MOP
<br>NIL<br>CL-USER> (use-package :contextl)<br>T<br>CL-USER> (deflayer foo-layer ())<br>#<CONTEXTL::LAYER-CLASS LAYER-CLASS-DEFINERS::|COMMON-LISP-USER::FOO-LAYER|><br>CL-USER> (defclass bar () ())<br>#<STANDARD-CLASS BAR>
<br>CL-USER> (define-layered-method baz :in-layer foo-layer ((obj bar))<br> (format t "~&baz primary :in-layer foo-layer~%"))<br>#<STANDARD-METHOD LAYERED-FUNCTION-DEFINERS::|COMMON-LISP-USER::BAZ| (LAYER-CLASS-DEFINERS::|COMMON-LISP-USER::FOO-LAYER|
<br> BAR) {40513681}><br>CL-USER> (defvar *b* (make-instance 'bar))<br>*B*<br>CL-USER> (with-active-layers (foo-layer)<br> (baz *b*))<br>
; in: LAMBDA NIL<br>; (BAZ *B*)<br>; <br>; caught STYLE-WARNING:<br>; undefined function: BAZ<br><br>; <br>; caught STYLE-WARNING:<br>; This function is undefined:<br>; BAZ<br>; <br>; compilation unit finished
<br>; caught 2 STYLE-WARNING conditions<br>; Evaluation aborted<br>CL-USER> <br><br><br><br>Thanks,<br>Nick<br>