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

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Nov 29 16:29:39 UTC 2009


How can ECL decide to cache a DEFTYPE form? I mean, the following is
utterly absurd, but it may well happen:

(deftype foo () (declare (special *foo-expansion*)) *foo-expansion*)

On Sun, Nov 29, 2009 at 3:45 PM, Tobias C. Rittweiler <tcr at freebits.de> wrote:
>
> 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.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>



-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list