Is there a for
loop or for each
loop in Scheme ?
I've been searching around and found there is a keyword "every
" but the scheme compiler language I'm using does not have this function pre-build in. This is what it suppose to do, it can be find here
(define (first-letters sent)
(every first sent))
> (first-letters '(here comes the sun))
(H C T S)
How can I re-write the every
function ? using other pre-defined function. The language I'm using is in the DrScheme - Essentials of Programming Languages (3rd ed)
I tried all the pre-installed compiler in DrScheme none of them can compile the every
function.
Any ideas ?