X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=if.lisp;fp=if.lisp;h=5664a60d9a1eddba65200111c3cf5a758c1b9481;hb=f590c554e7d2e0eaf32377427416a29f69a74034;hp=881c62956b537b25ca6c5fbc4b8c2166faf8a9fc;hpb=bb182c7eda90fcb76d7bbf99b13a49d40c0a8847;p=lifp.git 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)