From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: (define-module (foo) #:import (...)), a la r6rs Date: Tue, 06 Dec 2011 12:30:31 +0100 Message-ID: <87ty5endig.fsf@pobox.com> References: <87fwlqvgg9.fsf@pobox.com> <87wrf2w13m.fsf@gnu.org> <87hb2cdhc0.fsf@pobox.com> <87pqh0zwi5.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 1323187896 17147 80.91.229.12 (6 Dec 2011 16:11:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2011 16:11:36 +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 Tue Dec 06 17:11:32 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RXxcB-0005bp-TX for guile-devel@m.gmane.org; Tue, 06 Dec 2011 17:11:32 +0100 Original-Received: from localhost ([::1]:54598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXxcB-00045j-Bv for guile-devel@m.gmane.org; Tue, 06 Dec 2011 11:11:31 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXxc4-0003rV-4f for guile-devel@gnu.org; Tue, 06 Dec 2011 11:11:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXxbu-0001sK-2e for guile-devel@gnu.org; Tue, 06 Dec 2011 11:11:23 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:49861 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXxbt-0001sE-Sw; Tue, 06 Dec 2011 11:11:14 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id C1BD8748A; Tue, 6 Dec 2011 11:11:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=kjxWnX/Jim0e ym4T3lYOE8hSe/8=; b=V5tYsiNdl6CPiFJj4gwP52irwWvFOcpWzrkPtrRbMPlb K2AzHCwKw/8ne+SIFAUj5pWqMC+lwCld91I288/m3sPxklMpFc1zi5xvaIyCcBF/ KAtwE8RI5l7VLZaI3hytu6PZra2S79jkFtK3yaP02rZY+jtz+8BwULJlriB9wdE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=wQR3GC 1R8J15Hm+kHuFY4AfNc4ne6FGBjl3yY/lqwBl5vK2rgTi+IfP3b34p8VEoNndrPL oTp7Px9puqDoLACjfFzvLQWLsLL5M2H32IY5NNJyw3YnEWotIHQkkSuVqDvR60Nr an8Wd04MCw8isw+2CMBeD4VZz+CW29ve8lae4= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id BBA227489; Tue, 6 Dec 2011 11:11:13 -0500 (EST) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 0C5C47488; Tue, 6 Dec 2011 11:11:12 -0500 (EST) In-Reply-To: <87pqh0zwi5.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 10 Nov 2011 00:50:10 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: EB095AB6-2024-11E1-A3EA-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12989 Archived-At: Hello :) On Thu 10 Nov 2011 00:50, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo skribis: > >> On Thu 28 Jul 2011 23:23, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> >>> Andy Wingo skribis: >>> >>>> (define-module (foo) >>>> #:import ((bar) >>>> (only (baz) qux foo) >>>> ...)) >>>> >>>> Or even: >>>> >>>> (define-module (foo) >>>> (import (bar) >>>> (only (baz) qux foo) >>>> ...)) >>> >>> I=E2=80=99d prefer #:use-modules (plural), for consistency: >>> >>> (define-module (foo) >>> #:use-modules ((bar) >>> (baz) #:select (qux foo) >>> (chbouib) #:renamer (symbol-prefix-proc 'p))) >> >> I don't like the paren placement so much. Consistency is important, but >> TBH I think that we should phase out the "use-module" / "use-modules" >> terminology, in favor of "import" terminology of r6rs and the coming >> r7rs. > > I find aesthetics important, but phasing out such an important construct > =E2=80=9Cjust=E2=80=9D for aesthetics seems harsh to me. Yeah, but it is not simply aesthetics: it is consistency with other schemes, `import' is the natural converse of `export', and the important cases of "import only these bindings", "rename these particular bindings", and "import this module with a prefix" are really easy in the r6rs import language. > Besides, stuff like #:renamer is strictly more powerful than what > R[67]RS provide, IIRC. No argument there! But I rarely use it. Even #:select is a bit of a PITA to use: #:use-module ((a) #:select (b c d)) #:use-module ((e) #:renamer (symbol-prefix-proc 'p:)) vs (import (only (a) b c d) (prefix (e) p:)) In particular the #:use-module variant has non-obvious paren placement for #:select two places: the wrapper for the whole form, and the list of bindings. And of course #:renamer would still be there for you to use. if you wanted to. Dunno, I still think this would be a good idea, but I think we would need to come to agreement first. Andy --=20 http://wingolog.org/