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
Thanks to all who contributed to this thread!! I agree with most of what you
said.
However, we are mixing up three different, independent issues:
1. My initial post was about political aspects: Ubuntu does not want to build
the binary with position-dependent coding (include the -no-pie flag),
Hi Lindsay,
> (de odd? (X) (bit? 1 X) )
> ...
> : (odd? 1) -> 1
> : (odd? 2) -> NIL
> ...
> : (fish odd? (1 2 3))
> !? (bit? 1 X)
> (1 2 3) -- Number expected
This happens because 'fish' applies the function to *all* elements of its second
argument, not just the atomic ones.
> (de odd? (X) (a