[racket] cond and else together

From: Bo Gus (forumangus at gmail.com)
Date: Tue Oct 22 04:08:02 EDT 2013

Using DrRacket v5.3.6, if I enter:

(define (tax pay)
  (cond
    ((<= pay 240.0) 0)
    ((<= pay 480.0) (* (/ 15 100) pay))
    ((else ((+ (* (/ 15 100) 480) (* (/ 28 100) (- pay 480))))))))

I get error

else: not allowed as an expression in: (else ((+ (* (/ 15 100) 480) (* (/
28 100) (- pay 480)))))

Can you not have an expression in an else clause?  Can an else only contain
a simple value?  What am I doing wrong?

This is HTDP ex 4.4.2 by the way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131022/2a2891bd/attachment.html>

Posted on the users mailing list.