Functional variant of 'oneof' function in Racket
问题 I have written following function to find if one and only one of 5 variables is true: (define (oneof v w x y z) (or (and v (not w) (not x) (not y) (not z)) (and w (not v) (not x) (not y) (not z)) (and x (not v) (not w) (not y) (not z)) (and y (not v) (not w) (not x) (not z)) (and z (not v) (not w) (not x) (not y)) )) (xor takes only 2 arguments) However, it is very imperative and not functional. Moreover, I want to write a function (oneof N) which will be generic rather than specific for 5