From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20147 invoked by alias); 26 Jan 2014 18:34:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 20137 invoked by uid 89); 26 Jan 2014 18:34:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f182.google.com Received: from mail-we0-f182.google.com (HELO mail-we0-f182.google.com) (74.125.82.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 26 Jan 2014 18:34:27 +0000 Received: by mail-we0-f182.google.com with SMTP id w62so4502228wes.13 for ; Sun, 26 Jan 2014 10:34:24 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.79.165 with SMTP id k5mr57545wjx.44.1390761264305; Sun, 26 Jan 2014 10:34:24 -0800 (PST) Received: by 10.194.17.104 with HTTP; Sun, 26 Jan 2014 10:34:24 -0800 (PST) In-Reply-To: <87ha8xujk2.fsf@gnu.org> References: <52dd9a9e.c394420a.3c12.04a4@mx.google.com> <83txcygg4h.fsf@gnu.org> <87ha8xujk2.fsf@gnu.org> Date: Sun, 26 Jan 2014 18:34:00 -0000 Message-ID: Subject: Re: [PATCH v2 02/36] Guile extension language: doc additions From: Doug Evans To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Cc: Eli Zaretskii , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00969.txt.bz2 On Tue, Jan 21, 2014 at 1:11 PM, Ludovic Court=E8s wrote: > Doug Evans skribis: > >> On Mon, Jan 20, 2014 at 7:37 PM, Eli Zaretskii wrote: >>>> Date: Mon, 20 Jan 2014 14:00:03 -0800 >>>> From: Doug Evans >>>> Cc: "gdb-patches@sourceware.org" >>>> >>>> On Mon, Jan 20, 2014 at 1:52 PM, Doug Evans wrote: >>>> > This patch has the doc additions. >>>> > There's still some to be written, but I think it's in good enough sh= ape >>>> > to get feedback on. >>>> > >>>> > Changes from v1: >>>> > - NEWS file added >>>> > - guile.texi updated based on feedback >>>> > - new section on gdb smobs >>>> > - add more text to "Iterators In Guile" node >>>> > >>>> > 2014-01-20 Doug Evans >>>> > >>>> > * NEWS: Mention Guile scripting. >>>> > >>>> > doc/ >>>> > * Makefile.in (GDB_DOC_FILES): Add guile.texi. >>>> > * gdb.texinfo >>>> > * guile.texi: New file. > > Overall looks good to me. > >> ++The implementation uses Guile's @dfn{smob} (small object) >> ++data type for all @value{GDBN} objects >> ++(@pxref{Defining New Types (Smobs),,, guile, GNU Guile Reference Manua= l}). >> ++This allows gluing Guile into @value{GDBN} very easily. > > SMOBs are a mechanism to define new Scheme data types, rather than a > data type in itself. > > More importantly, I=92m not sure whether it=92s worth mentioning it here. > What about replacing these two sentence with something like > =93@value{GDBN} defines several Scheme data types.=94? "works for me" >> ++@node GDB Smobs >> ++@subsubsection GDB Smobs >> ++@cindex gdb smobs > > And definitely, the heading should be =93GDB Scheme Data Types=94 or > similar, IMO. Done. >> ++@value{GDBN} uses Guile's @dfn{smob} (small object) >> ++data type for all @value{GDBN} objects >> ++(@pxref{Defining New Types (Smobs),,, guile, GNU Guile Reference Manua= l}). >> ++The smobs that @value{GDBN} provides are called @dfn{gmobs}. > > That one is OK since it helps introduce =93gmob=94. ;-) > >> ++Every @code{gsmob} provides a common set of functions for extending >> ++them in simple ways. Each @code{gsmob} has a list of properties, >> ++initially empty. These properties are akin to Guile's object properti= es, >> ++but are stored with the @code{gsmob} > > Perhaps add =93for improved efficiency=94 (I assume that=92s the reason, > right?). > >> +(define iter (make-iterator my-list my-list >> + (lambda (iter) > > The indentation is wrong here (put =93(make-iterator=94 on the next line.) > >> +@smallexample >> -+(use-modules (gdb experimental)) >> ++(use-modules (gdb iterator)) >> +(define this-sal (find-pc-line (frame-pc (selected-frame)))) >> +(define this-symtab (sal-symtab this-sal)) >> +(define this-global-block (symtab-global-block this-symtab)) >> +(define syms-iter (make-block-symbols-iterator this-global-block)) >> -+(define functions (iterator-filter symbol-function? syms-iter #f)) >> ++(define functions (iterator-filter symbol-function? syms-iter)) > > (The obvious =91iterator->list=92 procedure would be nice.) > >> ++@deffn {Scheme Procedure} iterator-map proc iterator >> ++Return a list of @var{proc} applied to each element of @var{iterator}. > > What about: > > Return the list of objects obtained by applying @var{proc} to the object > pointed to by @var{iterator} and to each subsequent object. > >> ++@deffn {Scheme Procedure} iterator-filter pred iterator >> ++Return as a list the elements of @var{iterator} that satisfy @var{pred= }. > > Return the list of elements pointed to by @var{iterator} that satisfy > @var{pred}. Done. > Thanks! > > Ludo=92.