Changeset 5573


Ignore:
Timestamp:
Dec 3, 2006, 1:41:38 AM (18 years ago)
Author:
Gary Byers
Message:

Handle VALUES type specifiers in THE forms a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/compiler/nx0.lisp

    r5531 r5573  
    21632163    new))
    21642164
    2165 
     2165;;; Treat (VALUES x . y) as X if it appears in a THE form
    21662166(defun nx-form-type (form &optional (env *nx-lexical-environment*))
    21672167  (if (self-evaluating-p form)
    21682168    (type-of form)
    2169     (if (and (consp form)               ; Kinda bogus now, but require-type
     2169    (if (and (consp form)          ; Kinda bogus now, but require-type
    21702170             (eq (%car form) 'require-type) ; should be special some day
    21712171             (quoted-form-p (caddr form)))
     
    21752175          (nx-target-type (nx-declared-type form env))
    21762176          (if (consp form)
    2177             (if (eq (%car form) 'the)
    2178               (nx-target-type (cadr form))
     2177            (if (eq (%car form) 'the)
     2178              (destructuring-bind (typespec val) (%cdr form)
     2179                (declare (ignore val))
     2180                (let* ((ctype (values-specifier-type typespec)))
     2181                  (if (typep ctype 'values-ctype)
     2182                    (let* ((req (values-ctype-required ctype)))
     2183                      (if req
     2184                        (nx-target-type (type-specifier (car req)))
     2185                        '*))
     2186                    (nx-target-type (type-specifier ctype)))))
    21792187              (if (eq (%car form) 'setq)
    21802188                (nx-declared-type (cadr form) env)
    21812189                (let* ((op (gethash (%car form) *nx1-operators*)))
    2182                   (or (and op (cdr (assq op *nx-operator-result-types*)))       ;
     2190                  (or (and op (cdr (assq op *nx-operator-result-types*)))
    21832191                      (and (not op)(cdr (assq (car form) *nx-operator-result-types-by-name*)))
    21842192                      (and (memq (car form) *numeric-ops*)
Note: See TracChangeset for help on using the changeset viewer.