[asdf-devel] Apply *read-default-float-format* to lisp files

Robert Goldman rpgoldman at sift.info
Fri Jul 17 22:56:11 UTC 2009


Brett van de Sande wrote:
> I have some lisp source files that contain some (many)
> floating point numbers.  How can I use asdf to ensure
> these files are read using (setf *read-default-float-format* 'double-float)
> without setting *read-default-float-format* globally?
> 

If you don't want this globally, but you want it for all of the files in
your system, you could do something like

(defmethod asdf:perform :around ((op asdf:compile-op) (comp
asdf:cl-source-file))
   (let ((*read-default-float-format* 'double-float))
     (call-next-method)))

I am not sure whether you need to do this for the load-op, as well.

If you want this to be done only for YOUR system, you could make a new
subclass of cl-source-file (say "double-float-source-file"), attach the
:around method to that, and then set up your system to have
double-float-source-file as its default-component-class...

Note that these are very much off-the-cuff and not tested.




More information about the asdf-devel mailing list