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 13:56:53 -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="1797"; 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 19:57:22 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 1kMavK-0000Mz-6r for guile-user@m.gmane-mx.org; Sun, 27 Sep 2020 19:57:22 +0200 Original-Received: from localhost ([::1]:34974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMavJ-0000vu-8x for guile-user@m.gmane-mx.org; Sun, 27 Sep 2020 13:57:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMav6-0000vN-96 for guile-user@gnu.org; Sun, 27 Sep 2020 13:57:08 -0400 Original-Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:45947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMav4-0005N6-HC for guile-user@gnu.org; Sun, 27 Sep 2020 13:57:08 -0400 Original-Received: by mail-qv1-xf35.google.com with SMTP id cv8so4244181qvb.12 for ; Sun, 27 Sep 2020 10:57:05 -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=3XG6BKq3uoDQu9M//gGK9Tt1u5HU8y25GQ9L+T0DlkQ=; b=Db1w9D82JxUN+MXxd2nsyrbWy7kU1ac1ybQItl5Hfy0fC4U1IZjrIJNoiYXZ4tJz8Y FMlqd/sp2rvMggsE1SxUczikRDLiDVarY+RHlcOXTSI16qiJTul9M60MYVwiejYuls7X FaUAR8bZee+XSSUGfLaY3+X5jrVnAbFIu8QY+71dkSaQPLANwnabEFLGH0lBZ/6xgpiE nTbUSfEFOwWh3uO8v8/t6aNSF7t6hOKCfFyh30UUKAYhFaAKUCag6JUsI3jZ1kQUX64Q LAa/Lcx9a2N9ejGey9JLR74fWOq/JCQrL25VMSI4vBRR3h7Ezk1TjxHPLa5SjpHx+Oya IjhQ== 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=3XG6BKq3uoDQu9M//gGK9Tt1u5HU8y25GQ9L+T0DlkQ=; b=om5bsgY3cANiISNwr3LCm7WuPVE5uxvkBa2jXPb8Vu7QQONa7yBgZvNE6jku9LzMwu 6Gn0BcqiHHgjVS12FiPE95Fwb8grhd9NlxxfGi1jmpehDB6hMY8adMxA+UfUqJcsmvLB VV1O7aJpm/HdNAI9cZ5E+ikZnVEVrobnEJGi+efV9D7ZuX8urD6Y762NmcwssVtIAiAV x4ssjeVVIIQEHWbuEqbTqDt5kSblscOZ/yFV6lyUjBhK5FNvrNYNQJfhsrWM4atBVDoA kN1AUBA5Ohd5txq4dGB7x98JKx+CDqXzfEZywi1vHLdzHh3OP6RUnLlNQIm75NvFVTv2 ihoQ== X-Gm-Message-State: AOAM531HCX9PmUIEknAFHcuonYIOqfMvjU7fYrPSI4D0Gv/ZcWgTBnGQ IjBwucjUgG0D6XFhpDnPbSVkAEEm29z0wkFU4iHrgczgUFYkrA== X-Google-Smtp-Source: ABdhPJzsxNFkDjQ9HkDzW94TpGJFxE4VCPqu1HGfMHe5yZPlGIkFFhDnqDYyogi4QszZguCARxI/ya7s7yz/P5A4jvs= X-Received: by 2002:a0c:8d82:: with SMTP id t2mr8512188qvb.62.1601229424796; Sun, 27 Sep 2020 10:57:04 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=fthibault1969@gmail.com; helo=mail-qv1-xf35.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, HTML_MESSAGE=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-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:16950 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?