Reputation: 1
I've just started learning Scheme and I'm having some trouble. I am using petite chez scheme (64-bit) with Windows. I have been reading up on examples using the functions 'every' , 'keep' and 'accumulate' , which I understand are built in and known by petite (i.e. do not have to be defined before use). However when I enter the examples I have read to test them, an error is returned. For example-
;; To make nouns plural
(define (plural noun)
(if (equal? (last noun) ’y)
(word (bl noun) ’ies)
(word noun ’s)))
> (every plural ’(beatle turtle holly kink zombie)) ;; Example input
(BEATLES TURTLES HOLLIES KINKS ZOMBIES) ;; Expected output
Instead I receive the error "variable every is not bound". It is as if 'every' is being treated as a variable rather than a known function. I receive the same error when I try examples with 'keep' and 'accumulate'. The coding is correct I assume (since it is copied from the book I'm reading). Am I wrong in thinking that these functions are built in and do not need to be defined or is there some other issue? Hope someone can shed some light on this.
Upvotes: 0
Views: 819
Reputation: 236004
The every
procedure is defined in SRFI-1 and is not part of the standard language. Refer to this project for the SRFIs available in Chez Scheme.
And besides, I don't think every
is the procedure you're looking for, what you want to do is a map
- please check the documentation first!
(map plural '(beatle turtle holly kink zombie))
Upvotes: 2