Patch for misc.lisp



Hi,
I've had a look at misc-lisp (and in particular the *rearray function)
and have come up with some clean up. I think that in the long term
misc.lisp is superflous, since most calls to *rearray are vacous (they
don't accomplish anything and can be eliminated) and the remaining
ones can be changed to direct calls to adjust-array.
Anyway, I modified *rearray to eliminate the array-copying and remove
the restriction to one dimensional arrays.
Since the code is now so small that the diff would probably be
greater I append the file.

misc.lisp
---------

;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;     The data in this file contains enhancments.                    ;;;;;
;;;                                                                    ;;;;;
;;;  Copyright (c) 1984,1987 by William Schelter,University of Texas   ;;;;;
;;;     All rights reserved                                            ;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(in-package "MAXIMA")

;;  Maclisp compatibility package

;;  ARRAY-SYMBOL can be either an array object or a symbol.
;;  IGNORE is normally the type.
;;  *REARRAY of one arg is supposed to return the array.

(defun *rearray (array-symbol &optional ign &rest dims)
  (declare (ignore ign))
  (check-arg array-symbol (or (symbolp array-symbol) (arrayp array-symbol))
	     "a symbol or an array")
  ;;All references to *rearray now are to symbols with the
  ;; value cell being used for the array.
  (cond ((null dims))
	(t (let* ((old-array (if (symbolp array-symbol)
				 (symbol-value array-symbol)
				 array-symbol))
		  (new-array (adjust-array old-array dims)))
	     (if (symbolp array-symbol)
		 (setf (symbol-value array-symbol)  new-array))
	     new-array))))

(defun runtime ()
  (get-internal-run-time))


----------------

I hope this is a step forward to clean up the code base.

'Andreas


-- 
Wherever I lay my .emacs, there's my $HOME.