Python complaints

Patrick Tufts zippy at cs.brandeis.edu
Wed Nov 24 01:40:21 EST 1999


In article <221119992150405215%zippy at cs.brandeis.edu>, Patrick Tufts
<zippy at cs.brandeis.edu> wrote:

> Here's an example:
> 
> (defun foo (x) (mod x 4))    ; return x mod 4, always an integer
> 
> (defun bar (x) (^ 2 x))      ; return 2^x, always an integer
> 
> (defun baz (a b) (+ (foo a) (bar b)))  ; foo(a) + bar(b)

A reader has pointed out that this is a bogus example, because foo and
bar are not guaranteed to return ints (among other things).

I could give an example like 

(defun foo (x) 4)
(defun bar (x) 3)
(defun baz (a b) (+ (foo a) (bar b)))

but that's so simple that it's not very interesting, and my mind is too
fuzzy now to come up with an interesting example.

If anyone else is up to the challenge of correctly saying what I should
have, please do.

--Pat




More information about the Python-list mailing list