[plt-scheme] (no subject)

From: igor denisov (denisovigor1971 at rambler.ru)
Date: Sat Jan 21 05:07:30 EST 2006

Hello there

Can somebody help me to figure out what is wrong with these codes. 
DrScheme V208
Language: Beginning Student.

;; hours->wages : list-of-numbers  ->  list-of-numbers
;; to create a list of weekly wages from a list of weekly hours (alon)
(define (hours-wages alon)
     ((empty? alon) empty)
     (else (cons (wage (first alon)) (hours-wages (rest alon))))))

;; wage : number  ->  number
;; to compute the total wage (at $12 per hour)
;; of someone who worked for h hours
(define (wage h)
     ((empty? h) 0)
    (* 12 (first h)
      (wage (rest h))
Produces a bug: first: expects argument of type <non-empty list>; 
given 0

(define (dollar-store l)
     ((empty? l) 0)
               (< (first l) 1)
              (< (dollar-store (rest l)) 1))
(define l
   (cons .98 (cons .87 (cons .76 (cons .34 empty)))))
Produces a bug: <: expects argument of type <real number>; given 'l

Thanks in advance.

Posted on the users mailing list.