From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QOLcCk0fQ2IMfwAAgWs5BA (envelope-from ) for ; Tue, 29 Mar 2022 17:01:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CE1XA00fQ2KoFAEAG6o9tA (envelope-from ) for ; Tue, 29 Mar 2022 17:01:33 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A7C71EF4D for ; Tue, 29 Mar 2022 17:01:32 +0200 (CEST) Received: from localhost ([::1]:44254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZDLf-0007j1-Fb for larch@yhetil.org; Tue, 29 Mar 2022 11:01:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZDJX-0006DK-Ft for guix-devel@gnu.org; Tue, 29 Mar 2022 10:59:19 -0400 Received: from [2a02:1800:120:4::f00:13] (port=52760 helo=baptiste.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZDJV-0003B3-55 for guix-devel@gnu.org; Tue, 29 Mar 2022 10:59:19 -0400 Received: from [10.45.5.151] ([193.190.253.145]) by baptiste.telenet-ops.be with bizsmtp id CEzA2701138zUG101EzC0u; Tue, 29 Mar 2022 16:59:12 +0200 Message-ID: Subject: Re: A lexical use-modules? From: Maxime Devos To: guile-devel@gnu.org, guix-devel@gnu.org Date: Tue, 29 Mar 2022 16:59:06 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Iqu+sPi+/eZD00JzV+qN" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1648565952; bh=12CwShiCmXRJ9FyOfcQ9OxRCfu+EqSQKY1VmRXCJFDg=; h=Subject:From:To:Date:In-Reply-To:References; b=gjhphuxLBVSYixayp9mYCYwRgvYm0Yv9WXHof4GzBIQzjFZnVtrSQw26QpCrdAeeZ PQxtyF7jkklqwH8nniPNDvrK6zkiFzz7YmrUAsLLnsyzqC3Fo7WifD6xx26MERFT3P ILtRsBlPEINZHOP64KaiDRC/+Ynji4rSbBI0QsWYMbUGsHQlKp+ZKETASgo7D9lLsu miQij3hyv7L3kzMmiXeXPiQp7K9ap9Ish3Berov9mm5H1b1Ap8dW4kWeBwu7Au+YMJ HhwoVbKIU4aMhU3xOtD4auCvk3Yja2r1p48s0FFugwMij/+JZOXFS6Apxw9Vs+9MK1 2KGq5Wp7hIraQ== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:120:4::f00:13 (failed) Received-SPF: pass client-ip=2a02:1800:120:4::f00:13; envelope-from=maximedevos@telenet.be; helo=baptiste.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648566092; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=12CwShiCmXRJ9FyOfcQ9OxRCfu+EqSQKY1VmRXCJFDg=; b=Iyo0z/QfR6e84wofd+S7RoiFJ58lPGRGdXtvMyJ3RNjoSHs4qG42DLiJBGiwR08UeRkZ6D 5nBqTlIdRZI+2+uhJMXoSqJ4tynvqpTQBmJmJrOU0xdoSVritogfHY8WuHew2TSoiAvwvX 8DzlZhMgUImlFOopkXqghYS7f33t2vaFC6hZtb8/oVEHQ1YXs8kxYEgVK3xEQQ4L8gAaBL joxsc+/5UJkl9ZdVhEqQZidiUcyANXlKtzT84lXlsFmROi0FtgHBZ77W/MOlXUv6kxM6lM EX13XK9UzJPPxqKAmqc+rNQ4SYt2SpsqG/91kWczJAF/geTBAnE7fhLqZmLowA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648566092; a=rsa-sha256; cv=none; b=fL8xmzvBDrhmAj3O+kMgn42gqmgtLad6rmH/zz9OzMQH4O03JNxC7DQBLI2GMrtOCUbQfv eSBBTOnUIZfJkp3yzmCS6aWu/5FIU46Y1C9LpVyPg0ZXLTRRkhknQgDPAUetSX5+bFb7bv TJ6yW44nd/CorzbenpGA1XX9epKrbHiCSHJLGDC9ISVYgCoiSHV89NmX2JOwm7oPjKi3+C ckIEBdsDAuaY+KX7PqdDzRsnNNnR3Ckta0PbE8A2EdbH+Be1Rdr95W7DCxTiG4Pkbef4Xv Faf94Ef3NaDAgL64D2XgXHEU/dcPNZRp+mJnAV1JkuB/Tss8amg8LHPVfV1PxA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=gjhphuxL; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.77 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=gjhphuxL; dmarc=pass (policy=none) header.from=telenet.be; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A7C71EF4D X-Spam-Score: -8.77 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6ckECRyJxBSz --=-Iqu+sPi+/eZD00JzV+qN Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxime Devos schreef op za 26-03-2022 om 20:21 [+0100]: > (define-syntax use-module/lexical > =C2=A0 ;; todo: integrate into (use-modules ...)? > =C2=A0 (lambda (s) > =C2=A0=C2=A0=C2=A0 (syntax-case s () > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((_ foo) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let* ((module-name (syntax->datum #= 'foo)) > =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 (interface (resolve-interface module-name))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (define (binding->import= name variable) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (define name= -syntax (datum->syntax s name)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #`(define-sy= ntax #,name-syntax (identifier-syntax (@ foo > #,(datum->syntax #'irrelevant name))))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #`(begin #,@(module-map = binding->import interface))))))) This probably does not interact perfectly with 'syntax-parameterize', 'bound-identifier=3D?'/'free-identifier=3D?' and 'syntax-local-binding', though I guess it is good enough for most practical purposes. Greetings, MAxime. --=-Iqu+sPi+/eZD00JzV+qN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkMeuhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nwfAP9FRU4xZsQLri8FSFIAqD5PN6p6 uARKke7HT2K5LI4yTAD8CgbCrnxQwk38q6jvSURNZ0OsGs7/MdU7OokUxaNyeg4= =+DoE -----END PGP SIGNATURE----- --=-Iqu+sPi+/eZD00JzV+qN--