Comp 210 Lab 6: Writing qsort-big-list

;; (qsort-big-list)
;; A function which takes no arguments,
;; sorts big-list (**which must be already defined**),
;; and then just returns #t.
;; (Intended for use with time-apply.)
;;
(define qsort-big-list
(lambda ()
     (let ((tra-la-la (qsort big-list))) ;; we want to calculate this value,
                                         ;; but we ignore the result
        #t)))
Of course, what we really want is a function where we give it any list nums, and it makes a function like above, and then calls time-apply. That is, we want a function time-qsort which will take a list nums, create a new function which takes no arguments, and sorts nums, and then passes that new function to time-apply.

We now know how to do that, remembering that functions are just values (and they are created with lambda). You may also want to use local, though the intrepid can do it without local. Try writing this with your neighbor before you check out a solution.


Back to Lab 6