Re: split-sequence



Tin Gherdanarra <tinman31337@xxxxxxxxx> writes:

> On cliki and in the cl-cookbook I read that
> split-sequence:split-sequence is used to
> uhm, to split a sequence. The examples show
> how it is used to split along a single element,
> like this:
>
> (split-sequence:split-sequence #\Space "just whisper 'wermuth'")
> gives
> ("just" "whisper" "wermuth")
> 22


Either you've got a strange split-sequence, or you don't know how to
copy-and-paste:

[159]> (split-sequence:split-sequence #\Space "just whisper 'wermuth'")
("just" "whisper" "'wermuth'") ;
22
>
> Is there a way to put split-sequence to work that
> it can split a sequence along another sequence,
> like this:
>
> (split:sequence:split-sequence "spam" "We have spam we have spam and spam")
> shall give
> ("We have" "we have" "and")

No, this will give an error:

[160]> (split:sequence:split-sequence "spam" "We have spam we have spam and spam")

*** - READ from
#<INPUT CONCATENATED-STREAM #<INPUT STRING-INPUT-STREAM>
#<IO TERMINAL-STREAM>>
: too many colons in token "split:sequence:split-sequence"
The following restarts are available:
ABORT :R1 ABORT
Break 1 [161]> :q


> I tried all sorts of args and options, to no avail.
> My guess is that split-sequence is not made for this.

Indeed, split sequence is not made for this.

A string is a sequence of CHARACTERS, not a sequence of substrings.

> [...]

--
__Pascal Bourguignon__ http://www.informatimago.com/

READ THIS BEFORE OPENING PACKAGE: According to certain suggested
versions of the Grand Unified Theory, the primary particles
constituting this product may decay to nothingness within the next
four hundred million years.
.



Relevant Pages

  • Re: split-sequence
    ... > Is there a way to put split-sequence to work that it can split a ... > sequence along another sequence, ... Lisp is not dead, it just smells funny. ... Prev by Date: ...
    (comp.lang.lisp)
  • split-sequence
    ... split-sequence:split-sequence is used to uhm, ... The examples show how it is used to split along a single element, ... passing it together with a format string to a formatter, ...
    (comp.lang.lisp)