From: grue Date: Fri, 10 Feb 2006 10:00:54 +0000 (+0000) Subject: add function "child" that returns the first child of an object X-Git-Url: https://jxself.org/git/?p=lifp.git;a=commitdiff_plain;h=09e2ca3c7abae98d97cbd8efedc45482e15c6169 add function "child" that returns the first child of an object darcs-hash:549f16b097c58f4103c59bb19c0b35a2bdf43461 --- diff --git a/if.lisp b/if.lisp index 6a0a3c2..881c629 100644 --- a/if.lisp +++ b/if.lisp @@ -40,7 +40,7 @@ :read-property :rp :read-property- :exec :exec* :abstractobject :name :names :parent :children :flags - :initflags :add-flags :has :hasnt :-> :give + :initflags :add-flags :has :hasnt :-> :give :child :ifclass :object :defaction :*meta* :move :rmv :ofclass :among :verb :extend-verb :extend-verb-first @@ -369,6 +369,10 @@ word in dictionary, add it." (not (intersection flags (flags obj)))) ;(not (subsetp flags (flags obj)))) +(defun child (obj) + "Returns the first child of the object" + (car (children obj))) + (defmethod parser ((obj abstractobject) words) "Default parser. Really bad one." (when (zerop (length words)) (return-from parser 0))