From debbugs-submit-bounces@debbugs.gnu.org Mon May 16 20:09:20 2022 Received: (at 55464) by debbugs.gnu.org; 17 May 2022 00:09:20 +0000 Received: from localhost ([127.0.0.1]:55381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqkm8-0003vT-B3 for submit@debbugs.gnu.org; Mon, 16 May 2022 20:09:20 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]:27402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqkm5-0003vC-7d for 55464@debbugs.gnu.org; Mon, 16 May 2022 20:09:19 -0400 Date: Tue, 17 May 2022 00:09:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1652746149; bh=zwMFnZprBfcUeB3c5QhEWHfktmspGEonVxB+hIisBBc=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=SX6/yPhLVNm+jpSe77rvdBeUsQYVxKsub0gS8T3ph/XvDmVkokQ+t0COFxsgysStH hk/ubGr+YoF2p4tJkdxinfnFxoLQqL3l+HelkIfhJs7bzwCMgvfmoNcNpg1IEdffjh ycJRKtQp7LCxxSK2e0+swE7AfaUg4dL0ujwy4ymkpIaPUQZ8NE57SOzf58hdSmSwZ7 tjZ871//ZYM43q+ii7MKbKB6QGu6BcHPgRWb6B21fEo6g4PxB433mR0Jak1vL/XzXL bIYl7EX6BlpKJFtMWRhQ8ZTiwHoLlf/8lu3OcVZT4CJnzyuUJyrJZa5oCVp8VeSRX8 DgaMwlQSb21pA== To: "55464@debbugs.gnu.org" <55464@debbugs.gnu.org> From: Attila Lendvai Subject: alternative way Message-ID: Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55464 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Attila Lendvai Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) as Ludovic kindly pointed out on IRC, i can use this instead: (module-filename (current-module)) unfortunately, this returns a relative path, which is only useful using (se= arch-path %load-path ...), which introduces some uncertainty about what act= ually gets loaded depending on the runtime value of %load-path... :| therefore, i decided to read the file at macroexpand-time. after some strug= gle with hygienic macros: (define-syntax read-module-relative-file (lambda (syn) (syntax-case syn () ((_ filename) (with-syntax ;; Read the file at compile time and macroexpand to the first fo= rm. ((form (%read-module-relative-file (current-module) (syntax->datum #'filename)))) #''form))))) (define (%read-module-relative-file module filename) (with-input-from-file (or (search-path %load-path (string-append (dirname (module-filename module)) "/" filename)) (error "%read-module-relative-file failed for" filename)) read)) not beautiful, but works. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CIt is just as difficult and dangerous to try to free a people that= wants to remain servile as it is to enslave a people that wants to remain = free.=E2=80=9D =09=E2=80=94 Niccol=C3=B2 Machiavelli (1469=E2=80=931527)