today I solve the N-queen problem using Scheme but it is extremely slow compared to the same version of Python. when N = 8, Scheme takes 90+ seconds! I know one reason is th
I have found that do performs significantly more quickly than iterating over a list:
(do ((i 0 (add1 i)))
((= i 100000) 'result)
(some-function! i some-data))
If you want to be more functional the Racket documentation suggests in-list for use with for and it's variants.
(for/list ((i (in-list (range 0 100000))))
(some-function i some-data))