[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: list building
From: |
Matt Hellige |
Subject: |
Re: list building |
Date: |
Wed, 14 Jan 2004 10:25:21 -0600 |
User-agent: |
Mutt/1.2.5i |
[Brian S McQueen <address@hidden>]
> I am building a list of string via various calls to C functions. When the
> list of strings is complete I pass it off to the C based printing
> function. Anyway, I find myself building the list like this:
>
> (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?
>
Maybe you've oversimplified the problem in your example, but it seems
like you can just do:
(define output-list
(list
(sgids pref-login)
(gids)
(getd pref-login)))
If you already have an output-list you need to preserve, then:
(set! output-list
`(,(sgids pref-login)
,(gids)
,(getd pref-login)
. ,output-list))
But again, my guess is there's some reason why this needs to be more
complicated...
Matt
--
Matt Hellige address@hidden
http://matt.immute.net
Re: list building,
Matt Hellige <=
Re: list building, Keith Wright, 2004/01/15