From f590c554e7d2e0eaf32377427416a29f69a74034 Mon Sep 17 00:00:00 2001 From: grue Date: Mon, 13 Feb 2006 20:50:52 +0000 Subject: [PATCH] below function darcs-hash:1e09aa5eaf5c8dfd2a366b28780a8331e48aeded --- if.lisp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/if.lisp b/if.lisp index 881c629..5664a60 100644 --- a/if.lisp +++ b/if.lisp @@ -42,7 +42,7 @@ :abstractobject :name :names :parent :children :flags :initflags :add-flags :has :hasnt :-> :give :child :ifclass :object :defaction :*meta* - :move :rmv :ofclass :among + :move :rmv :ofclass :among :below :verb :extend-verb :extend-verb-first :extend-verb-only :extend-verb-only-first :deftoken :string== :matchp :!last! @@ -744,7 +744,14 @@ word in dictionary, add it." (defun notin (obj &rest what) "Test whether the object is not in any of other arguments" (notany (lambda (x) (eql (parent obj) x)) what)) - + +(defun below (obj1 obj2) + "Tests whether obj1 is strictly below obj2 in object structure" + (loop for x = obj1 then (parent x) + while x + when (eql x obj2) do (return t) + finally (return nil))) + ;;SECTION 9: Verb functions (defstruct patternlist value) -- 2.31.1