From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: Proposal for a new (ice-9 history) Date: Fri, 2 Nov 2018 15:02:50 +0100 Message-ID: References: <87lg6gmg9s.fsf@netris.org> <878t2gklad.fsf@netris.org> Reply-To: mikael@djurfeldt.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000078772b0579aefe46" X-Trace: blaine.gmane.org 1541167272 23322 195.159.176.226 (2 Nov 2018 14:01:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2018 14:01:12 +0000 (UTC) Cc: guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Nov 02 15:01:08 2018 Return-path: Envelope-to: guile-devel@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 1gIa0Z-0005yd-FP for guile-devel@m.gmane.org; Fri, 02 Nov 2018 15:01:07 +0100 Original-Received: from localhost ([::1]:51855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIa2f-0005vV-S7 for guile-devel@m.gmane.org; Fri, 02 Nov 2018 10:03:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIa2Y-0005ka-Em for guile-devel@gnu.org; Fri, 02 Nov 2018 10:03:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIa2T-00078o-FK for guile-devel@gnu.org; Fri, 02 Nov 2018 10:03:10 -0400 Original-Received: from mail-it1-f177.google.com ([209.85.166.177]:39874) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIa2T-00078E-A7 for guile-devel@gnu.org; Fri, 02 Nov 2018 10:03:05 -0400 Original-Received: by mail-it1-f177.google.com with SMTP id m15so3280460itl.4 for ; Fri, 02 Nov 2018 07:03:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=ZpeA68t7kls4RrUlSLGlDnSq1H0xX/U+qOXIyJwvgiI=; b=kqtVqyRFIQHM4L6mpnnp6ZHXBVlWVdUwXrGmZaeShLuI8mhHRklG78IGapkeLp2TqI DsenJsl4XinDN3j5XGUOMVicLwYSOXIrEvbuTv+WSy1uD83dvyZWg9lf3dxR0Z8Qs/CC XQWRr3ktuLSosjYCZVBIl/ZfPmQKi7nnWxhkl0YJEaBaiFSrgsQx5QVXKKPu0vj3m8UB MkUJakwJ3jyaxbX0+nWAWBQ+g1LrOFrQ4+kgTA8TTAl7YTGhaBw494BI5uWIZM3TjigM 5Bibf3vijOP+waRNZ9aKeG7AL5+jCd/MDaFjLTxb9glAB26XDfxMJa29Jx0yBcZKlXAz +HCw== X-Gm-Message-State: AGRZ1gIUW1aE0RLI+fUCcW5j+RIzOVusxufqB6NRmyTvAImd1VxcQbCX HC3z5BItuKAUTD1ObZqVtDli7PKUt+FBiCBTfghvLw== X-Google-Smtp-Source: AJdET5e37CXdMBoEa6SfCp3DD02uuSg49QGqCygOhMN8osUn4jjd4EeGKFOqf0qkySVXTfy4auD9JwE0fXHwkOj5RZo= X-Received: by 2002:a02:1649:: with SMTP id a70-v6mr10503273jaa.128.1541167384124; Fri, 02 Nov 2018 07:03:04 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.166.177 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.devel:19712 Archived-At: --00000000000078772b0579aefe46 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 2, 2018 at 2:35 PM Mikael Djurfeldt wrote: > Given this situation, is there still a way to use the module system to > give (ice-9 match) $ precedence? There is. G=C3=B6ran Weinholt has pointe= d out > that other Scheme implementations tend to export their auxilliary keyword= s. > If we export $ like this: > > --8<---------------cut here---------------start------------->8--- > (define-module (ice-9 match) > #:export (match > [...] > match-letrec) > #:replace ($)) > [...] > --8<---------------cut here---------------start------------->8--- > > then (ice-9 match) will gracefully replace $ in (value-history) and match > will work as expected. A good idea would be to define *all* auxilliary > keywords to `misplaced' above, according to what G=C3=B6ran has said. Tha= t is > independent of the issue of name collisions. > Just to avoid misunderstanding. Of course, to avoid the hard-to-find bugs which G=C3=B6ran talked about, auxilliary keywords should be exported the n= ormal way (through export). That way name collisions will be reported. Possibly that is what we should do here as well, also for $, such that there is a warning when (ice-9 match) is imported. Also, what we really wanted to say is not that (ice-9 match) $ is "replacing". We rather wanted to say that (value-history) $ is "deferring", but there is no way to do that in the module system right now. --00000000000078772b0579aefe46 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Nov 2, 2018 at 2:35 PM Mikael Djurfeldt <mikael@djurfeldt.com> wrote:
Give= n this situation, is there still a way to use the module system to give (ic= e-9 match) $ precedence? There is. G=C3=B6ran Weinholt has pointed out that= other Scheme implementations tend to export their auxilliary keywords. If = we export $ like this:

--8<---------------cut here---------------start------------->8---
(define-module (ice-9 match)
=C2=A0 #:export (match
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= [...]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 match-letrec)
=C2=A0 #:replace ($))=
[...]
--8<---------------cut here---------------start------------->8---

then (ice-9 match) will gracefully replace $ in (valu= e-history) and match will work as expected. A good idea would be to define = *all* auxilliary keywords to `misplaced' above, according to what G=C3= =B6ran has said. That is independent of the issue of name collisions.
=

Just to avoi= d misunderstanding. Of course, to avoid the hard-to-find bugs which G=C3=B6= ran talked about, auxilliary keywords should be exported the normal way (th= rough export). That way name collisions will be reported. Possibly that is = what we should do here as well, also for $, such that there is a warning wh= en (ice-9 match) is imported.

Also, what we really= wanted to say is not that (ice-9 match) $ is "replacing". We rat= her wanted to say that (value-history) $ is "deferring", but ther= e is no way to do that in the module system right now.
--00000000000078772b0579aefe46--