[Ramarren was faster than me, he answered while I was still typing ...

]
The :test and :test-not keyword parameters are intended to be used as either :test or :test-not but not both at the same time. Altough it sometimes works [it's unspecified and therefore implementation dependent if an error will be signalled or not you give both] the result will usually be very confusing.
I think the main reason why there are both :test and :test-not is that Lisp originally was designed by mathematicians and testing numerical results often requires heavy complicated :test functions and often it's easier to write a :test-not math-test to exclude the opposite of the desired numbers.
The typical Lisp solution for your problem is to use an anonymous lambda-function as :test or :test-not argument, so both solutions shown below will work:
Code: Select all
(remove-duplicates "heyyyy cooooool aaaaaa"
:test #'(lambda (x y)
(and (char-equal x y)
(char/= x #\space)
(char/= y #\space))))
(remove-duplicates "heyyyy cooooool aaaaaa"
:test-not #'(lambda (x y)
(or (char-not-equal x y)
(and (char= x #\space)
(char= y #\space)))))
The :from-end keyword parameter is not necessarily needed here and can be omitted.
More code examples to manipulate strings [subtype of sequence] can be found in:
- edgar