official update
[lifp.git] / if.lisp
diff --git a/if.lisp b/if.lisp
index 08d5038aa070f1f779b87225b04cc1a2c0fdcf2a..6a0a3c22027967c87508b4a5f921265c80c8487a 100644 (file)
--- a/if.lisp
+++ b/if.lisp
            :addword :word2dic :addword2dic\r
            :split-to-words :sprint\r
            :parser :description :article :glance \r
-           :initnames :addnames\r
-           :read-property :read-property-string :read-property-number\r
-           :read-property-integer :read-property-object :read-property-execute\r
-           :read-property-other :read-property-list :exec :exec*\r
+           :initnames :addnames \r
+           :read-property :rp :read-property- \r
+           :exec :exec*\r
            :abstractobject :name :names :parent :children :flags\r
            :initflags :add-flags :has :hasnt :-> :give\r
            :ifclass :object :defaction :*meta*\r
@@ -89,7 +88,7 @@
   "make defvars for names"\r
   `(progn\r
      ,@(loop for x in names\r
-           collect `(defvar ,x))))\r
+           collect `(defvar ,x nil))))\r
 \r
 ;;SECTION 2: Global parameters and definitions\r
 \r
@@ -359,7 +358,7 @@ word in dictionary, add it."
 \r
 (defun give (obj &rest flags) \r
   "Informish synonim to add-flags." \r
-  (setf (flags obj) (combine-flags (append (flags obj) flags))))\r
+  (setf (flags obj) (combine-flags (append (flags obj) flags)))  nil)\r
 \r
 (defun has (obj &rest flags)\r
   "Informish macro has. Unlike Inform, can accept several flags."\r
@@ -478,6 +477,17 @@ word in dictionary, add it."
     (glance (apply #'read-property-string (slot-value self property) args))\r
     (t (slot-value self property))))\r
 \r
+(defun read-property- (method self property &rest args)\r
+  "read-property using specific method. method is one of keywords:\r
+   :string :number :object :integer :"\r
+  (case method\r
+    (:string (apply #'read-property-string (slot-value self property) args))\r
+    (:number (apply #'read-property-string (slot-value self property) args))\r
+    (:integer (apply #'read-property-string (slot-value self property) args))\r
+    (:object (apply #'read-property-string (slot-value self property) args))\r
+    (:execute (apply #'read-property-string (slot-value self property) args))\r
+    (:list (apply #'read-property-string (slot-value self property) args))\r
+    (t (slot-value self property))))\r
 \r
 ;;SECTION 7: IfClass macro and its hairy surroundings\r
 \r