From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Thibault Newsgroups: gmane.lisp.guile.user Subject: How to convert r7rs module using include-library-declarations to Guile? Date: Sun, 27 Sep 2020 15:07:10 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21172"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Sep 27 21:07:36 2020 Return-path: Envelope-to: guile-user@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 1kMc1H-0005QM-Jy for guile-user@m.gmane-mx.org; Sun, 27 Sep 2020 21:07:35 +0200 Original-Received: from localhost ([::1]:56394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMc1G-0005vb-CY for guile-user@m.gmane-mx.org; Sun, 27 Sep 2020 15:07:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMc16-0005vQ-DE for guile-user@gnu.org; Sun, 27 Sep 2020 15:07:24 -0400 Original-Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:35052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMc14-0004jn-OO for guile-user@gnu.org; Sun, 27 Sep 2020 15:07:24 -0400 Original-Received: by mail-qk1-x72b.google.com with SMTP id q5so8199041qkc.2 for ; Sun, 27 Sep 2020 12:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=4o5fBbN5xr88otgWqMpG/0UhL5bopldf3GJubYYmK9o=; b=qCUW7wnRDcTDGVsWEzBMrNP39j5cTct8NI/dv4G4Zv8N5O5Ix+ZTebmEkQcJeRRji0 ZcOfoquUDUpYb7dfhHQzv+Q7uZ7hUw7k30XaOolPCIZdcKvhYsrRabLEcwwiYp6s0+yK azChAYuV1hVI7g7RNI7QD4j+ww/2oYSPBbvVaao3TGdAwIjrjMPqFYwp9lTeZlBT/cK9 pS4mBQ0ieSoRZdq4U7IQKmJ9Cq3j9FZFx4Gq/zYTmIqTNchgi2W30OYG5+KfHtlOB9O2 6Z5htoQ9wiamYR1Tt4kDLnILYJqh7hGI6MC4hGD73IDGvrmiJR7FXYmZvDFOumJB0sgM j6iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4o5fBbN5xr88otgWqMpG/0UhL5bopldf3GJubYYmK9o=; b=dBZBGpqN0YSeqV2iznlB1+ejPwvxnrlPVdLgpahOhsEUfqGHsK8bxwofhg05rjAtfD aGu9WsCRC14CNT3z7HzEbOn8rrdl90FIYo9EB8k9avyqKD5eUJ0Lpa8XjwojBrSKMwy0 1GPH8jDqlekC+lHG3r8UFgXpoUc190hWvX2Hd0CBEVNQKg6+3Pe+i2GO3Vb2fuCK9bZK 3agA8Hdq+8uD+v+D/IurJjCUcPjODxhIuarrhCF5v6EOuzG1WN1s51U/gK2aIzMP7Agn QUlSFngCmZvZ/+UUZLiTlAE+a+0fH+Z8oMJCjjuiIWu5jcOx6iPvYGuLGqsEZo5r07IZ urRw== X-Gm-Message-State: AOAM531y/tsEY3er7RfR4T6CO55k1U27fguTvrKuovtZ9CH91hw1LJnW PuGFsDHtdAsFx/2GhNS/RM2pwrSykdbB5RH+XEF0/Fns+qPj4Q== X-Google-Smtp-Source: ABdhPJwwACx5yOEGgOlUf8A8mKvpohqn7Ek6cKeTyAsfqoeauhBA4MPaqNWeVYF7DwO0nLfpw/gFGngfWZRMHY7FRZs= X-Received: by 2002:a37:a347:: with SMTP id m68mr9075456qke.81.1601233641479; Sun, 27 Sep 2020 12:07:21 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::72b; envelope-from=fthibault1969@gmail.com; helo=mail-qk1-x72b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16951 Archived-At: I am working on a pattern-matcher that exports all of its auxiliary syntax ($ *** =.. *.. get! etc., a modified version of Alex Shinn's syntax). It works in Guile, and I'm trying to refactor it to use srfi-206, but if I try to import (only (srfi srfi-206 all) $ *** =.. etc) with just the names changed in guile-3 I get: source expression failed to match any pattern in form (()) If I simplify (srfi srfi-206 all) to: (define-library (srfi srfi-206 all) (include-library-declarations "all-exports.scm") (import (guile)) (begin (define-syntax define-identifier-syntax-parameter (syntax-rules () ((_ name e) (define-syntax name (syntax-rules () ((_ . _) e)))))) (define-syntax define-auxiliary-syntax (syntax-rules () ((_ name) (define-identifier-syntax-parameter name (syntax-error "invalid use of auxiliary syntax" name)))))) (include "all-definitions.scm")) I get: definition in expression context ... for form ((define-syntax define-identifier-syntx-parameter ...)) So I tried putting that module in Guile form: (define-module (srfi srfi-206 all)) (include-from-path "srfi/srfi-206/all-exports.scm") (import (guile)) (define-syntax define-identifier-syntax-parameter (syntax-rules () ((_ name e) (define-syntax name (syntax-rules () ((_ . _) e)))))) (define-syntax define-auxiliary-syntax (syntax-rules () ((_ name) (define-identifier-syntax-parameter name (syntax-error "invalid use of auxiliary syntax" name))))) (include-from-path "srfi/srfi-206/all-definitions.scm") and it loaded, but it didn't work: all the tests on the module that fail when the pattern-matcher doesn't recognize the renamed auxiliary syntax failed. Like (match '(1 2 2 2) ((a (? number? b) ...) b)) ERROR (match '(1 (2 2 2)) ((a (? number? b) ...) b)) => (2) Is there a way to convert this module to Guile-2 and Guile-3 as it is now?