Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Old mail has arrived.


devel / comp.lang.lisp / .Re: Mapcar: how can I pass the list index to the function?

SubjectAuthor
o .Re: Mapcar: how can I pass the list index to the function?Robert L.

1
.Re: Mapcar: how can I pass the list index to the function?

<suujqj$1ug2$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!cnMFwgAl3AZSZhKJg9s53w.user.46.165.242.75.POSTED!not-for-mail
From: No_spamming@noWhere_7073.org (Robert L.)
Newsgroups: comp.lang.lisp
Subject: .Re: Mapcar: how can I pass the list index to the function?
Date: Sun, 20 Feb 2022 23:45:24 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <suujqj$1ug2$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="64002"; posting-host="cnMFwgAl3AZSZhKJg9s53w.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 23:45 UTC

On Feb 5, 1:56 pm, Brian Houser <brianlhou...@gmail.com> wrote:
> Hi comp.lang.lisp,
>
> I'm relatively new to common lisp, so forgive me if this should be
> obvious:  Is it possible to pass the list index to the function using
> mapcar?  For example:
>
> > (mapcar #'(lambda (x index) (if (oddp index) T NIL)) '(1 2 3 4))
>
> (NIL T NIL T)
>
> Thanks!
> Brian

Gauche Scheme:

(map list
(lrange 0)
'(a b c d))

===>
((0 a) (1 b) (2 c) (3 d))


devel / comp.lang.lisp / .Re: Mapcar: how can I pass the list index to the function?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor