From: Isotope
Subject: concatetnating strings through dolist
Date: 
Message-ID: <a40k9q$21i$1@yarrow.open.ac.uk>
Hi,

I would appreciate any help that could be given to me. I would like to write
a function which can accumulate a string while looping through a list. E.g.

(dolist (resource *resource-list*)
  ?????

Where *resource-list* is a list of classes and I want to create one string
from a particular slot of all the classes in the list.

So, for example, if there are two classes in the resource list, and a slot
(e.g. colour), then if the first class has the slot value "red" and the
other has "blue" I want to return the string "red blue".

Thanks,

Annika

From: Dr. Edmund Weitz
Subject: Re: concatetnating strings through dolist
Date: 
Message-ID: <m3n0yk2i0y.fsf@dyn138.dbdmedia.de>
"Isotope" <·········@open.ac.uk> writes:

> I would appreciate any help that could be given to me. I would like
> to write a function which can accumulate a string while looping
> through a list. E.g.
> 
> (dolist (resource *resource-list*)
>   ?????
> 
> Where *resource-list* is a list of classes and I want to create one
> string from a particular slot of all the classes in the list.
> 
> So, for example, if there are two classes in the resource list, and
> a slot (e.g. colour), then if the first class has the slot value
> "red" and the other has "blue" I want to return the string "red
> blue".

<http://agharta.de/cookbook/strings.html>

See especially the section about concatenating strings and the
JOIN-STRING-LIST function.

HTH,
Edi.

-- 

Dr. Edmund Weitz
Hamburg
Germany

The Common Lisp Cookbook
<http://agharta.de/cookbook/>
From: Isotope
Subject: Re: concatetnating strings through dolist
Date: 
Message-ID: <a40m4o$2r2$1@yarrow.open.ac.uk>
Thanks, that's helped a lot.

Annika

"Dr. Edmund Weitz" <···@agharta.de> wrote in message
···················@dyn138.dbdmedia.de...
> "Isotope" <·········@open.ac.uk> writes:
>
> > I would appreciate any help that could be given to me. I would like
> > to write a function which can accumulate a string while looping
> > through a list. E.g.
> >
> > (dolist (resource *resource-list*)
> >   ?????
> >
> > Where *resource-list* is a list of classes and I want to create one
> > string from a particular slot of all the classes in the list.
> >
> > So, for example, if there are two classes in the resource list, and
> > a slot (e.g. colour), then if the first class has the slot value
> > "red" and the other has "blue" I want to return the string "red
> > blue".
>
> <http://agharta.de/cookbook/strings.html>
>
> See especially the section about concatenating strings and the
> JOIN-STRING-LIST function.
>
> HTH,
> Edi.
>
> --
>
> Dr. Edmund Weitz
> Hamburg
> Germany
>
> The Common Lisp Cookbook
> <http://agharta.de/cookbook/>