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 3289 for branches


Ignore:
Timestamp:
2015-06-23T08:39:32-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r3288 r3289  
    5656   (exponents :initarg :exponents :accessor monom-exponents
    5757              :documentation "The powers of the variables."))
     58  ;; default-initargs are not needed, they are handled by SHARED-INITIALIZE
     59  ;;(:default-initargs :dimension 'foo :exponents 'bar :exponent 'baz)
    5860  (:documentation
    5961   "Implements a monomial, i.e. a product of powers
     
    7072(defmethod shared-initialize :after ((self monom) slot-names
    7173                                     &key
    72                                        dimension
    73                                        exponents
    74                                        exponent
     74                                       (dimension 0 dimension-supplied-p)
     75                                       (exponents nil exponents-supplied-p)
     76                                       (exponent  nil exponent-supplied-p)
    7577                                     &allow-other-keys
    7678                                       )
     
    7981    (case slot-name
    8082      (dimension
    81        (cond (dimension
     83       (cond (dimension-supplied-p
    8284              (setf (slot-value self 'dimension) dimension))
    83              (exponents
     85             (exponents-supplied-p
    8486              (setf (slot-value self 'dimension) (length exponents)))
    8587             (t
    86               (error "DIMENSION or EXPONENTS must not be NIL"))))
     88              (error "DIMENSION or EXPONENTS must be supplied."))))
    8789      (exponents 
    8890       (cond
    89          ;; when exponents are supplied
    90          (exponents
     91         (exponents-supplied-p
    9192          (let ((dim (length exponents)))
    92             (when (and dimension (/= dimension dim))
     93            (when (and dimension-supplied-p (/= dimension dim))
    9394              (error "EXPONENTS must have length DIMENSION"))
    9495            (setf (slot-value self 'dimension) dim
Note: See TracChangeset for help on using the changeset viewer.