From: grue Date: Mon, 13 Feb 2006 20:50:52 +0000 (+0000) Subject: below function X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=f590c554e7d2e0eaf32377427416a29f69a74034;hp=bb182c7eda90fcb76d7bbf99b13a49d40c0a8847;p=lifp.git below function darcs-hash:1e09aa5eaf5c8dfd2a366b28780a8331e48aeded --- 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)