Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The world is coming to an end. Please log off.


devel / comp.lang.lisp / Re: .Re: Simple problem in PG's ANSI Common Lisp

SubjectAuthor
* .Re: Simple problem in PG's ANSI Common LispRobert L.
`- Re: .Re: Simple problem in PG's ANSI Common LispRobert L.

1
.Re: Simple problem in PG's ANSI Common Lisp

<svb3vg$1dku$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!9vX9WqADbcG1VgJGr1/H5Q.user.46.165.242.75.POSTED!not-for-mail
From: No_spamming@noWhere_7073.org (Robert L.)
Newsgroups: comp.lang.lisp
Subject: .Re: Simple problem in PG's ANSI Common Lisp
Date: Fri, 25 Feb 2022 17:34:42 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <svb3vg$1dku$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Info: gioia.aioe.org; logging-data="46750"; posting-host="9vX9WqADbcG1VgJGr1/H5Q.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. - Fri, 25 Feb 2022 17:34 UTC

paul graham wrote:

> Or you could write
>
> (defun pos+ (lst)
> (let ((i -1))
> (mapcar #'(lambda (x) (+ x (incf i)))
> lst)))
>
> Btw, in Arc that would be
>
> (def pos+ (lst)
> (let i -1
> (map [+ _ (++ i)] lst)))

It's better in Gauche Scheme.

(define (pos+ lst)
(map + lst (lrange 0)))

(pos+ '(200 300 400 500))
===>
(200 301 402 503)

Another way:

(use gauche.sequence) ;; map-with-index

(define (pos+ lst)
(map-with-index + lst))

(pos+ '(200 300 400 500))
===>
(200 301 402 503)

Re: .Re: Simple problem in PG's ANSI Common Lisp

<t15cpf$11l$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!MOmOui1bQ+HBQTE09bwFKw.user.46.165.242.75.POSTED!not-for-mail
From: No_spamming@noWhere_7073.org (Robert L.)
Newsgroups: comp.lang.lisp
Subject: Re: .Re: Simple problem in PG's ANSI Common Lisp
Date: Sat, 19 Mar 2022 20:00:50 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <t15cpf$11l$1@gioia.aioe.org>
References: <svb3vg$1dku$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Info: gioia.aioe.org; logging-data="1077"; posting-host="MOmOui1bQ+HBQTE09bwFKw.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 Mar 2022 20:00 UTC

On 2/25/2022, Robert L. wrote:

> It's better in Gauche Scheme.
>
> (define (pos+ lst)
> (map + lst (lrange 0)))
>
> (pos+ '(200 300 400 500))
> ===>
> (200 301 402 503)

Shorter:

(define (pos+ lst)
(map + lst (liota)))

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor