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
"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/>
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/>