guile-user
[Top][All Lists]
Advanced

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

Re: list building


From: Keith Wright
Subject: Re: list building
Date: Thu, 15 Jan 2004 01:26:11 -0500

> 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.  ---




reply via email to

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