close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 2354


Ignore:
Timestamp:
2015-06-18T20:59:23-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r2351 r2354  
    8686                                       )
    8787  ;;(format t "MONOM::SHARED-INITIALIZE called with:~&SLOT-NAMES: ~W~&INITARGS: ~W.~%" slot-names initargs)
    88   (let* ((new-dimension (cond (dimension dimension)
    89                               (exponents
    90                                (length exponents))
    91                               (t
    92                                (error "DIMENSION or EXPONENTS must not be NIL"))))
    93          (new-exponents  (cond
    94                            ;; when exponents are supplied
    95                            (exponents
    96                             (make-array (list new-dimension) :initial-contents exponents))
    97                            ;; when all exponents are to be identical
    98                            (exponent
    99                             (make-array (list new-dimension) :initial-element exponent
    100                                         :element-type 'exponent))
    101                            ;; otherwise, all exponents are zero
    102                            (t
    103                             (make-array (list new-dimension) :element-type 'exponent :initial-element 0)))))
    104     (setf (slot-value self 'dimension) new-dimension
    105           (slot-value self 'exponents) new-exponents)))
     88  (if (eq slot-names t) (setf slot-names '(dimension exponents)))
     89  (dolist (slot-name slot-names)
     90    (ecase slot-name
     91      (dimension
     92       (cond (dimension (setf (slot-value self 'dimension)) dimension)
     93             (exponents
     94              (setf (slot-value self 'dimension) (length exponents)))
     95             (t
     96              (error "DIMENSION or EXPONENTS must not be NIL"))))
     97      (exponents 
     98       (cond
     99         ;; when exponents are supplied
     100         (exponents
     101          (setf (slot-value self 'exponents)
     102                (make-array (slot-value self 'dimension) :initial-contents exponents)))
     103         ;; when all exponents are to be identical
     104         (exponent
     105          (setf (slot-value self 'exponents)
     106                (make-array (list new-dimension) :initial-element exponent
     107                            :element-type 'exponent)))
     108         ;; otherwise, all exponents are zero
     109         (t
     110          (setf (slot-value self 'exponents)
     111                (make-array (list new-dimension) :element-type 'exponent :initial-element 0))))))))
     112
    106113
    107114
Note: See TracChangeset for help on using the changeset viewer.