Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #331: those damn raccoons!


comp / comp.lang.lisp / Re: Python syntax in Lisp and Scheme

SubjectAuthor
o Re: Python syntax in Lisp and SchemeB. Pym

1
Subject: Re: Python syntax in Lisp and Scheme
From: B. Pym
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Fri, 13 Sep 2024 20:38 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: Re: Python syntax in Lisp and Scheme
Date: Fri, 13 Sep 2024 20:38:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <vc27r9$11j3k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Fri, 13 Sep 2024 22:38:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b23a757b35dd03cbd4947edb1cfbe6d8";
logging-data="1100916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ATbb0SrjmBEUJgi1Htzxt"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:recIxVkeiA/zOksAx4cd97t2bdQ=
View all headers

Paul Rubin wrote:

> > Scheme
> > (define vector-fill!
> > (lambda (v x)
> > (let ((n (vector-length v)))
> > (do ((i 0 (+ i 1)))
> > ((= i n))
> > (vector-set! v i x)))))
>
> I think you could write the scheme code like this:
>
> (define vector-fill! (v x)
> (let ((i 0))
> (while (< i (length v))
> (vector-set! v i x)
> (set! i (1+ i)))))

Gauche Scheme

(define myvec (vector 0 0 0 0 0))
(vector-fill! myvec 99)

1

rocksolid light 0.9.8
clearnet tor