From: Ram Bhamidipaty <ram@ve...>  20050422 22:39:26

Here are the changes I needed to make to get the current cvs head version of clocc to compiler under sbcl0.8.21. The changes are: 1. According to some of the docs I found evalwhen with compile, load eval is deprecated and the new thing is :compiletoplevel etc. So I made those changes. Turns out this change is not required, but it did reduce some of the warning messages. 2. *randomstate* is being added to the commonlisp package. sbcl has this package locked and thus the compile fails. I added some commands that unlock the package to allow this symbol to be defined. Probably there are many portability issues that I am not thinking about  someone with more experience with lisp will need to think about that. 3. the definition of +betaalgogo+ needs to be moved closer to the start of the file. otherwise sbcl will complain that this symbol is undefined when trying to compile zigguratinit. I hope these patches can be incorporated into clocc. Ram axis47b> cvs diff c rng.lisp Index: rng.lisp =================================================================== RCS file: /cvsroot/clocc/clocc/src/cllib/rng.lisp,v retrieving revision 1.14 diff u 3 p c r1.14 rng.lisp cvs diff: conflicting specifications of output style *** rng.lisp 8 Mar 2005 22:50:54 0000 1.14  rng.lisp 22 Apr 2005 22:32:10 0000 *************** *** 108,114 **** ;;;; Initial revision ;;;; ! (evalwhen (compile load eval) (require :cllibbase (translatelogicalpathname "clocc:src;cllib;base")) ;; `dfloat', `withtype' (require :cllibwithtype (translatelogicalpathname "cllib:withtype")))  108,114  ;;;; Initial revision ;;;; ! (evalwhen (:compiletoplevel :loadtoplevel :execute) (require :cllibbase (translatelogicalpathname "clocc:src;cllib;base")) ;; `dfloat', `withtype' (require :cllibwithtype (translatelogicalpathname "cllib:withtype"))) *************** *** 165,170 ****  165,176  ;; ;; where r = x[n]. ;; + (evalwhen (:compiletoplevel :execute) + (defconstant +betaalgogo+ 0.009572265238289d0) + (declaim (type (doublefloat 0.009572265238289d0 0.009572265238289d0) + +betaalgogo+)) + ) + (defun zigguratinit (n r v scale f finv) ;; n = one less than the number of elements in the tables ;; r = x[n] *************** mean of mu: *** 243,250 ****  249,258  STATE is the random state to use. The logarithmic method is used. " + (declare (disablepackagelocks commonlisp) (declare (type randomstate *randomstate*) (type (doublefloat (0d0)) mu)) + (declare (enablepackagelocks commonlisp)) (* mu ( (log (random 1d0))))) *************** order ORDER. *** 1562,1573 **** ( (gengammavariatesmallorder r) (log x))))))  (evalwhen (compile eval)  (defconstant +betaalgogo+ 0.009572265238289d0)  (declaim (type (doublefloat 0.009572265238289d0 0.009572265238289d0)  +betaalgogo+))  )  ;; Ahrens and Dieter's Algorithm GO. #+(or) (defun gengammavariatealgogo (a &optional (*randomstate* *randomstate*))  1570,1575  *************** with parameters a and b: *** 1822,1828 **** ;;; Binomial random variate #+(or) ! (evalwhen (compile eval) (declaim (ftype (function ((and (integer 0) fixnum) (nonnegativefloat doublefloat 1d0) &optional randomstate)  1824,1830  ;;; Binomial random variate #+(or) ! (evalwhen (:compiletoplevel :execute) (declaim (ftype (function ((and (integer 0) fixnum) (nonnegativefloat doublefloat 1d0) &optional randomstate) *************** with parameters N and p: *** 1877,1883 **** ;;; Poisson random variate #+(or) ! (evalwhen (compile) (declaim (ftype (function ((doublefloat 0d0) &optional randomstate) (and (integer 0) fixnum)) genpoissonvariate)))  1879,1885  ;;; Poisson random variate #+(or) ! (evalwhen (:compiletoplevel) (declaim (ftype (function ((doublefloat 0d0) &optional randomstate) (and (integer 0) fixnum)) genpoissonvariate))) 