Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Where are the calculations that go with a calculated risk?


devel / comp.lang.lisp / .Re: CL: Processing more than one element of a sequence at a time?

SubjectAuthor
o .Re: CL: Processing more than one element of a sequence at a time?Robert L.

1
.Re: CL: Processing more than one element of a sequence at a time?

<sus7an$1e0$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16903&group=comp.lang.lisp#16903

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!eYeqBzNjiJ3ACJwkx5pzXw.user.46.165.242.75.POSTED!not-for-mail
From: No_spamming@noWhere_7073.org (Robert L.)
Newsgroups: comp.lang.lisp
Subject: .Re: CL: Processing more than one element of a sequence at a time?
Date: Sun, 20 Feb 2022 01:59:53 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <sus7an$1e0$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Info: gioia.aioe.org; logging-data="1472"; posting-host="eYeqBzNjiJ3ACJwkx5pzXw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: XanaNews/1.18.1.6
X-Notice: Filtered by postfilter v. 0.9.2
 by: Robert L. - Sun, 20 Feb 2022 01:59 UTC

Frode V. Fjeld wrote:

> Raffaele Ricciardi <rfflrccrd@gmail.com> writes:
>
> > in CL, is there an idiomatic way to process more than one element of a
> > sequence at a time?
>
> Yes: (loop for (a b) on list by #'cddr collect (cons a b))
>
> Or without LOOP, I'd do:
>
> (do ((a (pop list) (pop list))
> (b (pop list) (pop list))
> (result nil))
> ((null list) (reverse result))
> (push (cons a b) result))

Gauche Scheme:

(use srfi-1) ;; unfold

(define xs '(k 6 u 8 s 3))

(unfold null? (cut take <> 2) cddr xs)
===>
((k 6) (u 8) (s 3))


devel / comp.lang.lisp / .Re: CL: Processing more than one element of a sequence at a time?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor