From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Added srfi-214: flexvectors Date: Wed, 12 Oct 2022 14:22:27 +0200 Message-ID: <8735btw7ss.fsf@gnu.org> References: <87fspjzq67.fsf@vijaymarupudi.com> <8b6bb918e76adc83c5785f6e544c5169bba8f25d.camel@telenet.be> <87y23axvxu.fsf@vijaymarupudi.com> <5553e04cc9f3b7d4c421829c18b1188a867707ad.camel@telenet.be> <87pmomxpbh.fsf@vijaymarupudi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29905"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) Cc: guile-devel@gnu.org To: guile-devel@gnu.org Cancel-Lock: sha1:N2vUsWIXuTl4wblyzLWegqDfV24= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Oct 12 14:22:56 2022 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oialE-0007bY-HL for guile-devel@m.gmane-mx.org; Wed, 12 Oct 2022 14:22:56 +0200 Original-Received: from localhost ([::1]:37346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oialD-0008Qw-1G for guile-devel@m.gmane-mx.org; Wed, 12 Oct 2022 08:22:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiaku-0008Nm-MN for guile-devel@gnu.org; Wed, 12 Oct 2022 08:22:36 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:45880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiakt-00086r-3M for guile-devel@gnu.org; Wed, 12 Oct 2022 08:22:36 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oiakp-00071t-Ul for guile-devel@gnu.org; Wed, 12 Oct 2022 14:22:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Primidi 21 =?utf-8?Q?Vend=C3=A9miaire?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Chanvre X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Received-SPF: pass client-ip=116.202.254.214; envelope-from=guile-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21399 Archived-At: Hi Vijay, Sorry for the looong delay! Overall the patches look great to me. Below are comments and suggestions, mostly cosmetic. Vijay Marupudi skribis: > From 42206dec4d5e9ae51665c6e98ef07715b89b12fe Mon Sep 17 00:00:00 2001 > From: Vijay Marupudi > Date: Tue, 18 Jan 2022 20:52:08 -0500 > Subject: [PATCH] Added srfi-214: flexvectors > > Included code, documentation, and tests Please use the ChangeLog style for commit messages (see ‘git log’ for examples); as a welcome gift, we can do it for you though. :-) [...] > +@node Flexvectors > +@subsection Flexvectors > +@cindex flexvector General comments: • please leave two spaces after end-of-sentence periods (a convention eases navigation with Emacs); • use @dfn to decorate a term the first time it’s introduced, @code for identifiers, etc.; • limit lines to ~80 columns. > +Flexvectors are sometimes better known as a @url{https://en.wikipedia.org/wiki/Dynamic_array,dynamic arrays}. This data > +structure has a wide variety of names in different languages: Maybe add a first sentence before this one, like: “The @code{(srfi srfi-214)} module implements @dfn{flexvectors}, a data structure for mutable vectors with adjustable size.” > +@itemize @bullet{} You can drop @bullet{}. > +@item > +JavaScript and Ruby call it an array > +@item > +Python calls it a list > +@item > +Java calls it an ArrayList (and, before that, it was called a Vector) Add a semicolon at the end of the first two lines, a period for the last one. @code{ArrayList}. [...] > +++ b/module/srfi/srfi-214.scm > @@ -0,0 +1,735 @@ > +;;; -*- mode: scheme; coding: utf-8; -*- > +;;; > +;;; Copyright (C) Adam Nelson (2020). > +;;; Copyright (C) Vijay Marupudi (2022). Nitpick: should be: Copyright (C) 2022 … > +(define-module (srfi srfi-214)) > + > +(use-modules ((scheme base) > + #:prefix r7:) > + (scheme case-lambda) > + (scheme write) > + (srfi srfi-1) > + (srfi srfi-9) > + (srfi srfi-9 gnu) > + (srfi srfi-11) > + (rnrs io ports)) > + > + > +(export ; Constructors Please use a single ‘define-module’ clause with #:use-module and #:export lines (this is equivalent but that’s what we conventionally use and it makes the interface clearer upfront). Avoid using R6RS and R7RS modules as they pull in a whole lot of stuff. For example, maybe you can use (ice-9 binary-ports) instead of (rnrs io ports); maybe you don’t need (scheme …) at all because Guile most likely has equivalent things built in. > + make-flexvector flexvector > + flexvector-unfold flexvector-unfold-right > + flexvector-copy flexvector-reverse-copy > + flexvector-append flexvector-concatenate flexvector-append-subvectors > + Don’t export as it would expose implementation details (the record interface). > +(define (flexvector . xs) In general we try to add docstrings for all public top-level procedures. Bonus points if you can do that. :-) The rest looks great to me! Could you send an updated patch? Thanks, Ludo’.