From 5ffe3e441c648c9895f0ae2ea2927656d4e839d0 Mon Sep 17 00:00:00 2001 From: tony Date: Fri, 4 Jul 2008 21:58:36 +0200 Subject: [PATCH] doc cleanup. --- lsbasics.lsp | 7 +++++-- lsobjects.lsp | 33 ++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lsbasics.lsp b/lsbasics.lsp index 68a3b31..f55c31b 100644 --- a/lsbasics.lsp +++ b/lsbasics.lsp @@ -149,6 +149,8 @@ are no arguments. Vector reducing." (sum-1 (if (rest args) args (first args))) 0)) + + (defun prod-1 (x) (if (numberp x) x @@ -198,7 +200,8 @@ Returns the number of its arguments. Vector reducing" (defun if-else (a x y) "Args: (first x y) -Takes simple or compound data items FIRST, X and Y and returns result of -elementswise selecting from X if FIRST is not NIL and from Y otherwise." +Takes simple or compound data items FIRST, X and Y and returns result +of elementswise selecting from X if FIRST is not NIL and from Y +otherwise." (flet ((base-if-else (a x y) (if a x y))) (recursive-map-elements #'base-if-else #'if-else a x y))) diff --git a/lsobjects.lsp b/lsobjects.lsp index 098c5bb..8b0037a 100644 --- a/lsobjects.lsp +++ b/lsobjects.lsp @@ -60,10 +60,11 @@ (:nicknames :ls-objects :lsos) (:use :common-lisp) (:shadow :call-method :call-next-method :slot-value) - (:export ls-object objectp *object* kind-of-p make-object *message-hook* - *set-slot-hook* slot-value self send call-next-method call-method - defmeth defproto defproto2 - instance-slots proto-name)) + (:export ls-object objectp *object* kind-of-p make-object + *message-hook* + *set-slot-hook* slot-value self + send call-next-method call-method + defmeth defproto instance-slots proto-name)) (in-package :lisp-stat-object-system) @@ -109,17 +110,19 @@ Returns T if X is an object, NIL otherwise.") ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; AJR:FIXME:Is this going to cause issues with concurrency/threading? -;;; (need to appropriately handle interrupts). +;;; AJR:FIXME:Is this going to cause issues with +;;; concurrency/threading? +;;; (need to appropriately handle interrupts). Could change this to +;;; a stack or list that could handle modifications and interrupts +;;; in-line. (defvar *self* nil - "special variable to hold current value of SELF. -Assign to current object that we are working with.") + "special variable holding current value of SELF. +Assigned with current object being worked on.") (defun get-self () - "FIXME? better as macro?." + "Return object we are operating on, otherwise throw error." (if (not (objectp *self*)) - (error "not in a method")) + (error "Error: no method focused on.")) *self*) (defun has-duplicates (list) @@ -149,8 +152,10 @@ This should be simpler, right?" (if (objectp x) x (error "bad object - ~s" x))) (defun kind-of-p (x y) -"Args: (x y) + "Args: (x y) + Returns T if X and Y are objects and X inherits from Y, NIL otherwise." + (if (and (objectp x) (objectp y)) (if (member y (ls-object-preclist x)) t nil) nil)) @@ -689,9 +694,7 @@ a list of objects. IVARS and CVARS must be lists." (setf (ls-object-preclist *object*) (list *object*)) (add-slot *object* 'instance-slots nil) (add-slot *object* 'proto-name '*object*) -(add-slot *object* 'documentation nil) ; AJR - for SBCL compiler - ; issues about macro with - ; unknown slot +(add-slot *object* 'documentation nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; -- 2.11.4.GIT