Optimus wrote:...
- Code: Select all
(member 1 1) ; should return 1, but returns that 1 is invalid argument
(member 1 '(( 0 1 2 3) 9 1 5)) ;should return (1 2 3) 9 1 5 but currently only returns 1 5
The built in member function will result in an error if the second argument is not a list. (error message "*** - member: A proper list must not end with 1" in CLISP)
member does only traverse the list not lists within it. 1 is compared to (0 1 2 3), 9 and 1 and returns (1 5). That the first element happens to have a 1 in it's structure is irrelevant.
You should correct your tests as the implementation is correct
