[Ecls-list] [Suggestion] Caching expansion of type-specifier

Tobias C. Rittweiler tcr at freebits.de
Sun Nov 29 14:45:19 UTC 2009


Compile-file'ing something like

  (deftype foo ()
    (format t "~&Type FOO is being expanded!~%")
    'fixnum)
  
  (eval-when (:compile-toplevel)
     (print 'bar))
  (defun bar (x)
    (declare (type foo x))
    x)
  
  
  (eval-when (:compile-toplevel)
    (print 'quux))
  (defun quux (y)
    (declare (type foo y))
    y)

shows that the derived type specifier FOO is expanded lot of times by
ECL. Most other CL compilers actually cache the expansion. (The standard
is silent on the issue when and how often type-specifiers are expanded
-- except I think that TYPEP / SUBTYPEP etc. must expand again if their
environment is non-NIL.)

Hopefully that will speed up compilation somewhat.

  -T.





More information about the ecl-devel mailing list