Deutsch English Français Italiano |
<vc27r9$11j3k$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "B. Pym" <Nobody447095@here-nor-there.org> 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= Bytes: 1361 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)