From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Re: Should guile-3.0 cond-expand guile-2 and guile-2.2? Date: Wed, 11 Mar 2020 14:59:48 +0100 Message-ID: <87ftefj8kr.fsf@gnu.org> References: <87blpktrlt.fsf@trouble.defaultvalue.org> <87wo7wi48r.fsf@gnu.org> <87lfo7mwmc.fsf@trouble.defaultvalue.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="89535"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Andy Wingo , Guile Devel To: Rob Browning Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Mar 11 15:10:43 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jC24J-000NBw-JC for guile-devel@m.gmane-mx.org; Wed, 11 Mar 2020 15:10:43 +0100 Original-Received: from localhost ([::1]:52942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC24I-0000Am-JF for guile-devel@m.gmane-mx.org; Wed, 11 Mar 2020 10:10:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38557) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC1to-0003nq-DS for guile-devel@gnu.org; Wed, 11 Mar 2020 09:59:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jC1tn-0005hS-5b; Wed, 11 Mar 2020 09:59:51 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37928 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jC1tm-0006Pw-7t; Wed, 11 Mar 2020 09:59:50 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 =?utf-8?Q?Vent=C3=B4se?= an 228 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: <87lfo7mwmc.fsf@trouble.defaultvalue.org> (Rob Browning's message of "Tue, 10 Mar 2020 21:52:11 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20446 Archived-At: Hi Rob, (+ Cc: Andy.) Rob Browning skribis: > Ludovic Court=C3=A8s writes: > >> Rob Browning skribis: >> >>> $ guile-3.0 -c '(display (cond-expand (guile-2.2 "?\n"))) >>> ? >>> >>> Is that intentional? >> >> I think so, though I don=E2=80=99t think this was discussed here. >> >> The way I see it, it means that guile-3 is a superset of 2.2. > > OK, though that wasn't true for guile-2.2 with respect to 2.0? Oh, but there was not =E2=80=98guile-2.0=E2=80=99 symbol, right? > In any case, it'd be nice to have the policy documented, perhaps on > the srfi-0 info page. Agreed. > At the moment, I just needed a way to write code that behaved > differently with 3.0+ as compared to 2.2, because 2.2 doesn't support > define-module #:re-export-and-replace, and there's no functional > equivalent yet. > > For now I did this (I don't currently care about older than 2.2): > > (define (re-export-and-replace! . names) > (cond-expand > (guile-3.0 > (module-re-export! (current-module) names #:replace? #t)) > (guile-2.2 > (module-re-export! (current-module) names)) > (else > (module-re-export! (current-module) names #:replace? #t)))) > > And migrated all the relevant symbols out of the define-module form. > > Do we think that the norm will be for releases to cond-expand the > symbols for all their ancestors (up to some point)? i.e. guile 4 will > likely cond expand guile-3, guile-3.0, guile-3.1, ... and guile-2, > guile-2.2, and so on? My interpretation is that =E2=80=98guile-2.2=E2=80=99 is to be interpreted = as =E2=80=9C2.2 or any later backwards-compatible version [at a language level]=E2=80=9D. Thus, what =E2=80=98guile-4=E2=80=99 will mean will depend on the compatibi= lity story of 4.0 wrt. to 3.x. Ideally I guess we=E2=80=99d want to express things in terms of minor/major version (in)equalities rather than plain symbol matches. One can actually do that with a =E2=80=98syntax-case=E2=80=99 macro looking at =E2= =80=98minor-version=E2=80=99 etc., but that=E2=80=99s inconvenient. Ludo=E2=80=99.