Hi,
Yes, Common Lisp is not Scheme and somehow you have to make a choice -- my love goes to CL (while Scheme remains very interesting ).
Scheme seems more puristic imho but taking Racket for example when one of the basic Scheme concepts was (among them) that iteration is something that always can be expressed as a recursive construction, suddenly they come with a heap of mechanisms for for/list for/product for/sum for/array for/vector for/bit-vector and the nested for*/xxxxx family -- it is not pure iteration yet because it works as : (for ((i L)) ... ) where L is list (p.e. (for ((i '( 1 2 3)) -- but this is identical with the CL (dolist (i L) ... ) , then the index is fabricated as (range 1 10) (for ((i (range 1 10))) ... index 0..9 looks like iteration but in fact isn't .. then came the big step (in-range x y) , now the list is gone, it's a stream (and imho we can call this iteration now and we can expand it into the infinite (in-naturals) , this works now because being a stream and intercepted the lazy way. So I think there is an evolution into iterative contructions in some Schemes.
But this is not the only reason : in CL , when one defines :
(defun double (x) (+ x x)) (p.e. (double 2/3) -> 4/3
just like in a full numeric tower Scheme this works for fixnumbers , bignumbers , fractions , floats and complex numbers. It is understandable that such code will be slower than something as written in C. However CL can speed things up !!
(defun double (x)
(declare (fixnum x))
(+ x x))
(don't know how to do it in Scheme, except in Bigloo and that Racket has a switch called "typed Racket" ) , also lists when big are extremely slow to address (it's a connection of pointers) so when giving up the variadic nature in working with vectors , arrays etc... things will speed up remarkable.
http://www.iaeng.org/IJCS/issues_v32/issue_4/IJCS_32_4_19.pdfHowever (and rather logical imho) , if your lisp code is tuned to reach the speed of C , it starts looking as C and some things lisp is famous for, vanishes.
STALIN is fast, very fast , but imho it is a strpped down Scheme version (no complex numbers , no fractions (a slow thing) etc..)
So probably i will stay a CL devotee for ever
not meaning I don't like it very much to code in Scheme, Forth , Basic etc ...
OK, I'll have a look on the SDL packages available for CL.
Working on a fractal now representing a ships graveyard
(written in Clozure Common Lisp : -- these are the only lines of code needed to do the maths.
(defun the-ship (i x y cx cy maxit orb)
(if (or (= i maxit) (> orb 3)) i
(the-ship (1+ i) (- (* x x) (* y y) cx) (- (abs (* 2 x y)) cy) cx cy maxit (abs (* x y)))))
easy as sunday morning
best Rob (image is just a start, checking the formula works , the artistic side comes later , but will be completely CAD )
.