From 8032a7fe4b6d2470476115b307c105b93c4100e5 Mon Sep 17 00:00:00 2001 From: drewc Date: Thu, 6 Aug 2009 10:55:03 -0700 Subject: [PATCH 1/1] Add dlambda + contextl hack darcs-hash:20090806175503-39164-c7e7ede2ab7808d98121b2f91f5f6c4fc0f4d011.gz --- src/contextl-hacks.lisp | 5 +++-- src/ucw/contextl-components.lisp | 12 +++++++++++- src/ucw/standard-components.lisp | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/contextl-hacks.lisp b/src/contextl-hacks.lisp index b6af05e..5e568fa 100644 --- a/src/contextl-hacks.lisp +++ b/src/contextl-hacks.lisp @@ -1,7 +1,8 @@ (in-package :contextl) - +(defmethod contextl:layer-name :around (layer) + (or (call-next-method) layer)) ;;; HACK: ;;; Since i'm not using deflayer, ensure-layer etc, @@ -26,7 +27,7 @@ (call-next-method))) -;;; HACK: We are ending up with classes named NIL in the superclass list. +;;; HACK: There are classes named NIL (partial classes) in the superclass list. ;;; These cannot be given the special object superclass when re-initializing ;;; is it will be in the subclasses superclasses AFTER this class, causing ;;; a confict. diff --git a/src/ucw/contextl-components.lisp b/src/ucw/contextl-components.lisp index 0f4465e..b948d38 100644 --- a/src/ucw/contextl-components.lisp +++ b/src/ucw/contextl-components.lisp @@ -1,5 +1,14 @@ (in-package :lisp-on-lines-ucw) +(defmacro dlambda ((&rest args) &body body) + (let ((env (gensym))) + `(let ((,env (capture-dynamic-environment))) + (lambda (,@args) + (with-dynamic-environment (,env) + ,@body))))) + +(export '(dlambda) :lisp-on-lines-ucw) + (defclass contextl-application (standard-application) () (:default-initargs @@ -23,10 +32,11 @@ (with-dynamic-environment ((action-dynamic-environment action)) (call-next-method))) -(defmethod ucw-core:call-callbacks ((action contextl-action) frame request) +(defmethod ucw-core:call-callbacks :around ((action contextl-action) frame request) (with-dynamic-environment ((action-dynamic-environment action)) (call-next-method))) + (defclass contextl-component (standard-component) ((component-dynamic-environment :accessor component-dynamic-environment :initform nil)) diff --git a/src/ucw/standard-components.lisp b/src/ucw/standard-components.lisp index 3509a8a..94591df 100644 --- a/src/ucw/standard-components.lisp +++ b/src/ucw/standard-components.lisp @@ -4,7 +4,7 @@ () (:default-initargs :action-class 'lisp-on-lines-action)) -(defclass lisp-on-lines-action (contextl-action) +(defclass lisp-on-lines-action (action-with-isolation-support contextl-action ) () (:metaclass closer-mop:funcallable-standard-class)) -- 2.20.1