Would you like to ask on the SBCL mailing list?
Yes, I asked this question on #lisp and Andreas Fuchs has helped me posting it on SBCL. One of the reply said it should be a bug in SBCL because he gave an example showing the inconsistent behavior. Here's the example:
Andreas Fuchs posted:
(loop for i in '(1 2 3 a 4 5 6) if (not (symbolp i)) collect i into collector else do (setf collector nil) finally (return collector))
does not return (4 5 6), but (1 2 3 4 5 6).
And Alastair Bridgewater said:
Note using (1 2 3 a 4 5 6 b) as input will result in NIL.
Here's the function split-string in 0.6.0
(10defun split-string (11string &optional (separators " ,-")) "Splits STRING into substrings separated by the characters in the sequence SEPARATORS. Empty substrings aren't collected." (12loop for 13char across 14string
How did you manage to add those numbers there?
Hmm.... these are all the magic numbers added by copying from paste.lisp.org.
Here's the right one.
(defun split-string (string &optional (separators " ,-")) "Splits STRING into substrings separated by the characters in the sequence SEPARATORS. Empty substrings aren't collected." (loop for char across string when (find char separators :test #'char=) when collector collect (coerce collector 'string) into result and do (setq collector nil) end else collect char into collector finally (return (if collector (append result (list (coerce collector 'string))) result))))
Cheers, pebblestone