Hi John,
When something as GIMP uses it for its scripts , quatlity should be certified ...
The exe is a Lispish trick , it's the whole system renamed and the source of the program added in the init file
However : **********warning***************
The 1.41 is compiled with USE_MATH 0 , things like sin , cos , sqrt , floor ,ceiling etc etc will not work - can you recompile with USE_MATH 1 ? (i don't have a C compiler)
In the mean time switched to 1.39 -- another benchmark test : finding the primes below 5000 -- it's fast !!
----------------------------------------------------------------------------------
(newline)
(display "start")
(newline)
(define (seq x)
(let ((M '()))
(do ((i 0 (+ i 1)))
((> i x))
(set! M (cons i M))) M ))
(define numbers (reverse (seq 4999)))
(define (sieve L)
(let ( ( len (- (length L) 2)) (vec (list->vector L)) )
(do ((i 2 (+ i 1)))
((> i (floor (/ len 2))))
(when (> (vector-ref vec i) 0)
(do ((j 2 (+ j 1)))
((> (* i j) len))
(vector-set! vec (* i j) 0)))) vec ))
(define (print-vec V)
(let ((len (vector-length V)) (cnt 0) )
(do (( i 2 (+ 1 i)))
(( = i (- len 1)))
(let (( item (vector-ref V i)))
(when (not (= item 0))
(set! cnt (+ 1 cnt))
(display item)
(display " ")))) cnt ))
(define (main)
(let ((cnt 0))
(newline)
(display "calculating prime-numbers < 5000") (newline)
(display "--------------------------------") (newline)
(set! cnt (print-vec (sieve numbers)))
(newline)
(display "that's it")
(newline)
(display cnt) (display " prime numbers found") ))
(main)
--------------------------------------- attached in an exec.
It has vectors !!! -- this is very ! important , vectors are "typed" and are indexed , lists not and have to be assigned in a recursive way -- this is much faster , it's always possible to convert with (list->vector ) [if of a same type, of course , but calculations will speed up a lot ] and (vector->list ) (unlike CL only one dimension is possible , but for 2D you can make a set of 2 vectors p.e. for 3D - 3 etc...)
best Rob, this looks very good
(oops yes for primes < 10000 , you will have to allocate more memory -- not sure it can be done without recompiling (but I do not know)
.