Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #398: Data for intranet got routed through the extranet and landed on the internet.


comp / comp.lang.lisp / Two at a time

SubjectAuthor
o Two at a timeB. Pym

1
Subject: Two at a time
From: B. Pym
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Sun, 18 Aug 2024 21:17 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Nobody447095@here-nor-there.org (B. Pym)
Newsgroups: comp.lang.lisp
Subject: Two at a time
Date: Sun, 18 Aug 2024 21:17:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <v9toe2$2h8qo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Sun, 18 Aug 2024 23:17:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0f40b9e9af314fdf889d0c79293d5784";
logging-data="2663256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uZMam/TKNZzx8eTh8Q4Xv"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:qV4+9fWzHeMQaCPWq1xPBjQhAeo=
View all headers

> From a list of item '(joe barney cathy kevin stephy ...) I
> want a formated output like this:
>
> joe barney
> cathy kevin
> stephy ...
> ...
>
> In other words, I want a formated output in two (or more)
> columns, each separated by a tabulation. I don't know if the
> number of items is odd or even. I can do it with a simple
> function but can I do it within a single format expression? I
> have read some doc about the ~[~] and ~{~} directives but, in
> despite of a lot of tentatives, I can't do anything.

newLISP

(set 'lst '("joe" "barney" "cathy" "kevin" "stephy" "thomas" "bob"))

(dolist (two (explode (append lst '("")) 2 true))
(println (format "%s\t%s" two)))

joe barney
cathy kevin
stephy thomas
bob

1

rocksolid light 0.9.8
clearnet tor