Hi Lutz,
How about two new functions?
'even, which determines the even numbers from a value or a list
'odd, which determines the uneven numbers from a value or list
like ->
(map odd '( 1 2 3 4 5 6 7 8 9))
>(true nil true nil true nil true nil true)
(even 14)
> true
(odd '(3 5 8))
>(3 5)
(clean odd '( 3 5 7 4 8 ))
>( 4 8 )
Norman.
even and odd
even and odd
-- (define? (Cornflakes))
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
I don't know - does Lutz implement functions that are easy enough to do in newLISP anyway?
Or is there something that would be better done in the source?
Code: Select all
(map (fn (n) (!= 0 (mod n 2))) '(1 2 3 4 5))
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
Code: Select all
(find 2 (factor 928841234))