guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list building


From: Brian S McQueen
Subject: Re: list building
Date: Thu, 15 Jan 2004 09:49:57 -0800 (PST)

The cons* worked excellently.  When I used it a better structure became
clear.

BTW I do not seem to be getting all the message from this list.  Maybe it
is over aggressive spam filtering here at the office.

Brian

On Thu, 15 Jan 2004, Keith Wright wrote:

> > From: Brian S McQueen <address@hidden>
> >
> >         (set! output-list (cons (sgids pref-login) output-list))
> >         (set! output-list (cons (gids) output-list))
> >         (set! output-list (cons (getd pref-login) output-list))
> >
> > This seems very awkward.  How should I go about building a list a string
> > at a time?
>
> Several people have already urged you not to build a string
> at a time, but to make the whole list in one expression.
> To answer your question though:
> If you insist on adding one string at a time
>
>  (define (add-to-output str)
>    (set! output-list (cons str output-list)))
>  (add-to-output (sgids pref-login))
>  (add-to-output (gids))
>  (add-to-output (getd pref-login))
>
> --
>      -- Keith Wright  <address@hidden>
>
> Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
>          ---  Food, Shelter, Source code.  ---
>
>
> _______________________________________________
> Guile-user mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/guile-user
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]