From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24141 invoked by alias); 21 Jan 2014 21:11: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 24131 invoked by uid 89); 21 Jan 2014 21:11:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: hera.aquilenet.fr Received: from hera.aquilenet.fr (HELO hera.aquilenet.fr) (141.255.128.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2014 21:11:29 +0000 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 167A011E6; Tue, 21 Jan 2014 22:11:27 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MRrejN9zCklh; Tue, 21 Jan 2014 22:11:26 +0100 (CET) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 90944BBC; Tue, 21 Jan 2014 22:11:26 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Doug Evans Cc: Eli Zaretskii , "gdb-patches\@sourceware.org" Subject: Re: [PATCH v2 02/36] Guile extension language: doc additions References: <52dd9a9e.c394420a.3c12.04a4@mx.google.com> <83txcygg4h.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Pluvi=C3=B4se?= an 222 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Tue, 21 Jan 2014 21:11:00 -0000 In-Reply-To: (Doug Evans's message of "Tue, 21 Jan 2014 09:54:52 -0800") Message-ID: <87ha8xujk2.fsf@gnu.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-01/txt/msg00825.txt.bz2 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 sha= pe >>> > 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 Manual= }). > ++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=E2=80=99m not sure whether it=E2=80=99s worth mentionin= g it here. What about replacing these two sentence with something like =E2=80=9C@value{GDBN} defines several Scheme data types.=E2=80=9D? > ++@node GDB Smobs > ++@subsubsection GDB Smobs > ++@cindex gdb smobs And definitely, the heading should be =E2=80=9CGDB Scheme Data Types=E2=80= =9D or similar, IMO. > ++@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 Manual= }). > ++The smobs that @value{GDBN} provides are called @dfn{gmobs}. That one is OK since it helps introduce =E2=80=9Cgmob=E2=80=9D. ;-) > ++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 propertie= s, > ++but are stored with the @code{gsmob} Perhaps add =E2=80=9Cfor improved efficiency=E2=80=9D (I assume that=E2=80= =99s the reason, right?). > +(define iter (make-iterator my-list my-list > + (lambda (iter) The indentation is wrong here (put =E2=80=9C(make-iterator=E2=80=9D 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 =E2=80=98iterator->list=E2=80=99 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}. Thanks! Ludo=E2=80=99.