On 2016-06-19 11:49, Amirouche Boubekki wrote:

```
(define* ((xor* a b) uid)
  (if (procedure? a)
      (if (procedure? b)
          ((xor* (a uid) (b uid)) uid)
          ((xor* (a uid) b) uid))
      (if (procedure? b)
          ((xor* a (b uid)) uid)
          (xor a b))))
```


That procedure is buggy, since we can assume that (a uid) returns a boolean, there is no need for the extra xor* call.

The following does what is expected thanks to ijp:

(define ((xor* . fs) uid)
 (fold logxor 0 (map (lambda (f) (if (procedure? f) (f uid) f)) fs)))

--
Amirouche ~ amz3 ~ http://www.hyperdev.fr

Reply via email to