[cl-typesetting-devel] Re: Final zlib fix, and CLISP support

Klaus Weidner kw at w-m-p.com
Sun Apr 25 00:38:58 UTC 2004


On Sun, Apr 25, 2004 at 12:24:50AM +0200, Marc Battyani wrote:
> "Klaus Weidner" <kw at w-m-p.com>
> > - if uffi is not present or zlib is not loaded successfully,
> >   automatically set *compress-streams* to NIL.
> 
> ok but I've rather set *compress-streams* to nil in the defvar in
> config.lisp. it will be set to t only if zlib loads successfully

Good point, that's cleaner.

> Have you tried Edi's modification with CMUCL ? He kept the dynamic nature of
> #'load-zlib so this will also work in delivered images/exe. This is lost
> with your patch because you put the (uffi:def-function ("compress"
> c-compress) at the top level.

Almost - sbcl also needs the workaround, see attached patch.

With the additional change, cl-pdf works on CMUCL, SBCL and CLISP,
with compression being active for the first two and off for CLISP.

The attached cl-typesetting patch makes the complex single-page-example
work on clisp, including the table. It needs some settings to ensure the
expected floating point behavior and charset, which I've put in
specials.lisp for now.

One error reported by CLISP was a floating point underflow in the wavelet
rule, which may actually be conforming behavior. The exp value is
1.9d-41, which cannot be expressed in a single-float. The other
implementations apparently return zero here.

What still isn't working on CLISP are the splittable tables. I've fiddled
around with the code a bit, but the complex loop macros are terrible to
debug.

-Klaus
-------------- next part --------------
diff -urN -x *.fas -x *.lib orig/cl-pdf/init.lisp cl-pdf/init.lisp
--- orig/cl-pdf/init.lisp	Sat Apr 24 17:18:54 2004
+++ cl-pdf/init.lisp	Sat Apr 24 18:47:51 2004
@@ -15,7 +15,7 @@
    :drive-letters '("C" "D" "E")
    :types '("so" "a" "dll" "dylib"))))
 
-#+(and cmu uffi)
+#+(and uffi (or cmu sbcl))
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (let ((zlib-path (find-zlib-path)))
     (when zlib-path
-------------- next part --------------
diff -urN -x *.fas -x *.lib orig/cl-typesetting/cl-typesetting.asd cl-typesetting/cl-typesetting.asd
--- orig/cl-typesetting/cl-typesetting.asd	Thu Apr 22 05:23:18 2004
+++ cl-typesetting/cl-typesetting.asd	Sat Apr 24 18:32:45 2004
@@ -6,7 +6,6 @@
 
 (in-package asdf)
 
-#+(or allegro lispworks cmu sbcl openmcl mcl scl)
 (defsystem :cl-typesetting
     :name "cl-typesetting"
     :author "Marc Battyani <marc.battyani at fractalconcept.com>"
diff -urN -x *.fas -x *.lib orig/cl-typesetting/specials.lisp cl-typesetting/specials.lisp
--- orig/cl-typesetting/specials.lisp	Thu Apr 22 05:23:18 2004
+++ cl-typesetting/specials.lisp	Sat Apr 24 18:44:12 2004
@@ -4,6 +4,11 @@
 
 (in-package typeset)
 
+#+clisp
+(setq custom:*floating-point-contagion-ansi* t
+      custom:*warn-on-floating-point-contagion* nil
+      custom:*default-file-encoding* (ext:encoding-charset "iso-8859-1"))
+
 (defconstant +huge-number+ (truncate most-positive-fixnum 10))
 (defconstant +epsilon+ 0.0001)
 
diff -urN -x *.fas -x *.lib orig/cl-typesetting/test.lisp cl-typesetting/test.lisp
--- orig/cl-typesetting/test.lisp	Tue Apr 20 17:16:58 2004
+++ cl-typesetting/test.lisp	Sat Apr 24 18:34:20 2004
@@ -128,7 +128,7 @@
       (pdf:set-color-stroke (color box))
       (pdf:move-to (- dx/2) 0)
       (loop for x from (- dx/2) by 0.2
-	    for y = (* dy/2 (cos (* x 0.8)) (exp (* x x -0.006)))
+	    for y = (* dy/2 (cos (* x 0.8)) (exp (* x x -0.006d0)))
 	    while (< x dx/2)
 	    do (pdf:line-to x y))
       (pdf:stroke))))


More information about the cl-typesetting-devel mailing list