From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mathieu Lirzin Newsgroups: gmane.lisp.guile.bugs Subject: bug#24155: SRFI-10: Example from the manual fails to execute. Date: Wed, 10 Aug 2016 20:51:06 +0200 Message-ID: <87oa50bgpx.fsf@gnu.org> References: <87popodnci.fsf@gnu.org> <87d1lksy1p.fsf@pobox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1470855143 10996 195.159.176.226 (10 Aug 2016 18:52:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Aug 2016 18:52:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cc: 24155-done@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Aug 10 20:52:19 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXYby-0002i0-8C for guile-bugs@m.gmane.org; Wed, 10 Aug 2016 20:52:18 +0200 Original-Received: from localhost ([::1]:43266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXYbu-0002Fi-Vq for guile-bugs@m.gmane.org; Wed, 10 Aug 2016 14:52:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXYbl-0002Fa-WD for bug-guile@gnu.org; Wed, 10 Aug 2016 14:52:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXYbh-0004bt-TP for bug-guile@gnu.org; Wed, 10 Aug 2016 14:52:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXYbh-0004bp-QB for bug-guile@gnu.org; Wed, 10 Aug 2016 14:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bXYbh-0000if-M2 for bug-guile@gnu.org; Wed, 10 Aug 2016 14:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mathieu Lirzin Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 10 Aug 2016 18:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24155 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 24155-done@debbugs.gnu.org id=D24155.14708550822702 (code D ref 24155); Wed, 10 Aug 2016 18:52:01 +0000 Original-Received: (at 24155-done) by debbugs.gnu.org; 10 Aug 2016 18:51:22 +0000 Original-Received: from localhost ([127.0.0.1]:52599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXYb3-0000hV-V9 for submit@debbugs.gnu.org; Wed, 10 Aug 2016 14:51:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXYb2-0000hG-L8 for 24155-done@debbugs.gnu.org; Wed, 10 Aug 2016 14:51:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXYau-0004QV-Ao for 24155-done@debbugs.gnu.org; Wed, 10 Aug 2016 14:51:15 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXYau-0004QF-7L; Wed, 10 Aug 2016 14:51:12 -0400 Original-Received: from arennes-653-1-149-168.w92-135.abo.wanadoo.fr ([92.135.12.168]:54196 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1bXYas-0000o2-E3; Wed, 10 Aug 2016 14:51:10 -0400 In-Reply-To: <87d1lksy1p.fsf@pobox.com> (Andy Wingo's message of "Sun, 07 Aug 2016 11:55:46 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8376 Archived-At: Andy Wingo writes: > I replaced the text with this: > > We do not recommend #,() reader extensions, however, and for three > reasons. > > First of all, this SRFI is not modular: the tag is matched by name, > not as an identifier within a scope. Defining a reader extension in o= ne > part of a program can thus affect unrelated parts of a program because > the tag is not scoped. > > Secondly, reader extensions can be hard to manage from a time > perspective: when does the reader extension take effect? *Note Eval > When::, for more discussion. > > Finally, reader extensions can easily produce objects that can=E2= =80=99t be > reified to an object file by the compiler. For example if you define a > reader extension that makes a hash table (*note Hash Tables::), then it > will work fine when run with the interpreter, and you think you have a > neat hack. But then if you try to compile your program, after wrangli= ng > with the =E2=80=98eval-when=E2=80=99 concerns mentioned above, the com= piler will carp > that it doesn=E2=80=99t know how to serialize a hash table to disk. > > In the specific case of hash tables, it would be possible for Guile > to know how to pack hash tables into compiled files, but this doesn=E2= =80=99t > work in general. What if the object you produce is an instance of a > record type? Guile would then have to serialize the record type to di= sk > too, and then what happens if the program independently loads the code > that defines the record type? Does it define the same type or a > different type? Guile=E2=80=99s record types are nominal, not structu= ral, so > the answer is not clear at all. > > For all of these reasons we recommend macros over reader extensions. > Macros fulfill many of the same needs while preserving modular > composition, and their interaction with =E2=80=98eval-when=E2=80=99 is= well-known. If > you need brevity, instead use =E2=80=98read-hash-extend=E2=80=99 and m= ake your reader > extension expand to a macro invocation. In that way we preserve scopi= ng > as much as possible. *Note Reader Extensions::. I find this documentation helpful. Thank you. --=20 Mathieu Lirzin