Hi,

I have a function 'odd?', defined as

(de odd? (X) (bit? 1 X) )

This code works fine

: (odd? 1)  -> 1
: (odd? 2)  -> NIL
: (odd? (car '(1 2 3)))  -> 1

Why doesn't the following code work?

: (fish odd? (1 2 3))
!? (bit? 1 X)
(1 2 3) -- Number expected
? (fish odd? '(1 2 3))
!? (bit? 1 X)
(1 2 3) -- Number expected

What is also odd is that if I define 'odd? as

(de odd? (X) (and (num? X) (bit? 1 X)) )
-> odd?

Now it works with fish...

: (fish odd? (1 2 3))
-> (1 3)

Why?


/Lindsay

Reply via email to