From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Don't mix definitions and expressions in SRFI-9 Date: Mon, 07 Mar 2011 01:31:10 +0100 Message-ID: <87d3m3n54h.fsf@vir.lan> References: <8762rwqk2p.fsf@gmx.at> <87mxl77un3.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1299457892 21436 80.91.229.12 (7 Mar 2011 00:31:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2011 00:31:32 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Mar 07 01:31:27 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PwOM6-0004f0-VC for guile-devel@m.gmane.org; Mon, 07 Mar 2011 01:31:23 +0100 Original-Received: from localhost ([127.0.0.1]:33799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwOM6-0004hk-Fc for guile-devel@m.gmane.org; Sun, 06 Mar 2011 19:31:22 -0500 Original-Received: from [140.186.70.92] (port=37964 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwOM3-0004hc-AS for guile-devel@gnu.org; Sun, 06 Mar 2011 19:31:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwOM1-0008WL-Cz for guile-devel@gnu.org; Sun, 06 Mar 2011 19:31:19 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:38041) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PwOM1-0008Vw-0v for guile-devel@gnu.org; Sun, 06 Mar 2011 19:31:17 -0500 Original-Received: (qmail invoked by alias); 07 Mar 2011 00:31:15 -0000 Original-Received: from 83-215-154-5.hage.dyn.salzburg-online.at (EHLO nathot.lan) [83.215.154.5] by mail.gmx.net (mp018) with SMTP; 07 Mar 2011 01:31:15 +0100 X-Authenticated: #3102804 X-Provags-ID: V01U2FsdGVkX1+LuiI6jumLakjz/GM1gjL4o+rlFQHN1XdJR5zCid jLMM9apM5X3ZCF Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by nathot.lan (Postfix) with ESMTP id 3179C3A68F; Mon, 7 Mar 2011 01:31:14 +0100 (CET) Original-Received: from nathot.lan ([127.0.0.1]) by localhost (nathot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8hOBEvVCgBXc; Mon, 7 Mar 2011 01:31:11 +0100 (CET) Original-Received: from vir (vir.lan [192.168.3.10]) by nathot.lan (Postfix) with ESMTP id 478BA3A685; Mon, 7 Mar 2011 01:31:11 +0100 (CET) Original-Received: by vir (Postfix, from userid 1000) id E2A43BD693; Mon, 7 Mar 2011 01:31:10 +0100 (CET) In-Reply-To: <87mxl77un3.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 06 Mar 2011 23:26:40 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11802 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Andreas, > > Andreas Rottmann writes: > >> The expansion of `define-inlinable' contained an expression, which made >> SRFI-9's `define-record-type' fail in non-toplevel contexts ("definition >> used in expression context"). > > SRFI-9 says =E2=80=9CRecord-type definitions may only occur at top-level= =E2=80=9D, and > I=E2=80=99m inclined to stick to it. If we diverge, then people could wr= ite > code thinking it=E2=80=99s portable SRFI-9 code while it=E2=80=99s not. > I can certainly relate to that, and agree that it's a good principle, however, see below. > How about adding a =E2=80=98let-record-type=E2=80=99 or similar in (srfi = srfi-9 gnu)? > The issue is not that I'm explictly writing code that uses `define-record-type' in a non-toplevel context, but that I have a testing framework (built upon Riastradh's trc-testing), which uses R6RS `eval' to load testcases. Since `eval' does not allow for the code to be evaluated to be in a top-level context, I'm using this: (eval `(let () ,@code-to-be-tested) the-environment-for-the-code) Now `code-to-be-tested' can't contain any SRFI-9 record definitions if the literal interpretation of SRFI-9 is used, even if that code would run perfectly fine if entered at the REPL or being executed as an R6RS script (modulo the import statement, but the test runner can work around that). This is certainly a special use case, but I think it is reasonable one. Regards, Rotty --=20 Andreas Rottmann --