Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Research is to see what everybody else has seen, and think what nobody else has thought.


devel / comp.lang.lisp / .Re: I cannot find a word better than "CAR"

SubjectAuthor
o .Re: I cannot find a word better than "CAR"Robert L.

1
.Re: I cannot find a word better than "CAR"

<suqhvo$1tde$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!gSXBwBB/iIprw9K3nELhqg.user.46.165.242.75.POSTED!not-for-mail
From: No_spamming@noWhere_7073.org (Robert L.)
Newsgroups: comp.lang.lisp
Subject: .Re: I cannot find a word better than "CAR"
Date: Sat, 19 Feb 2022 10:49:30 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <suqhvo$1tde$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Info: gioia.aioe.org; logging-data="62894"; posting-host="gSXBwBB/iIprw9K3nELhqg.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. - Sat, 19 Feb 2022 10:49 UTC

> The one place I find myself frequently using CDD*R
> is in destructuring lists by "gulps" in LOOP, e.g.:
>
> > (defun group-by-triples (list)
> (loop for (a b c) on list by #'cdddr
> collect (list a b c)))
>
> GROUP-BY-TRIPLES
> > (group-by-triples '(0 1 2 3 4 5 6 7 8 9 10 11 12))
>
> ((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 NIL NIL))

Gauche Scheme:

(use srfi-1) ;; unfold

(define (group-by-triples xs . opts)
(unfold null? (cut apply take* <> 3 opts) (cut drop* <> 3) xs))

(group-by-triples '(0 1 2 3 4 5 6 7 8 9 10 11 12))
===>
((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12))

(group-by-triples '(0 1 2 3 4 5 6 7 8 9 10 11 12) #t 'ok)
===>
((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 ok ok))


devel / comp.lang.lisp / .Re: I cannot find a word better than "CAR"

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor