(do ((x (read stream nil eof) (read stream nil eof))
(l nil (cons x l)))
((eq x eof) (nreverse l))))))
+
+(defun safely-read-from-string (str &rest read-from-string-args)
+ "Read an expression from the string STR, with *READ-EVAL* set
+to NIL. Any unsafe expressions will be replaced by NIL in the
+resulting S-Expression."
+ (let ((*read-eval* nil))
+ (ignore-errors (apply 'read-from-string str read-from-string-args))))
+
+(defun parse-float (f)
+ (let ((*read-default-float-format* 'double-float))
+ (coerce (safely-read-from-string f) 'double-float)))