2
votes

I am using a program from the Simply Scheme book:

(require (planet dyoo/simply-scheme))
(define (combinations size set)
  (cond ((= size 0) '(()))
    ((empty? set) '())
    (else (append (prepend-every (first set)
                                 (combinations (- size 1)
                                               (butfirst set)))
                  (combinations size (butfirst set))))))

But, when I run it I get this error:

 expand: unbound identifier in module in: prepend-every

Any ideas on how to fix?

I am using DrRacket

2

2 Answers

4
votes

That function is defined earlier in the chapter, assuming you're reading Chapter 1. See prepend-every. Chapter 1 assumes you're doing the entire chapter in a single sitting, so some demo programs there will depend on functions that the authors had just talked about a few paragraphs before.

1
votes

I believe your issue is that is that "prepend-every" isn't defined anywhere.