From unknown Sat Jun 14 03:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40294: Documentation for arity procedures doesn't match behavior Resent-From: John Cowan Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 30 Mar 2020 02:36:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40294 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 40294@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158553573317355 (code B ref -1); Mon, 30 Mar 2020 02:36:07 +0000 Received: (at submit) by debbugs.gnu.org; 30 Mar 2020 02:35:33 +0000 Received: from lists.gnu.org ([209.51.188.17]:51453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIJDz-0000Nw-Vd for submit@debbugs.gnu.org; Sat, 28 Mar 2020 17:42:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33243) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIJDy-0002LG-LI for bug-guile@gnu.org; Sat, 28 Mar 2020 17:42:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIJDx-0001pH-FD for bug-guile@gnu.org; Sat, 28 Mar 2020 17:42:38 -0400 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:34038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIJDx-0001o6-2B for bug-guile@gnu.org; Sat, 28 Mar 2020 17:42:37 -0400 Received: by mail-qt1-x830.google.com with SMTP id 10so11899807qtp.1 for ; Sat, 28 Mar 2020 14:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=tc2WgLkWhiOd2Da6oGGNq266lYDZJO4Qvh1o9bgNUOs=; b=2SzH77+75ZxBWvn+Dsf2wnYY9el7X+xAPcjKzxUe2HJupEommT6YtJ9HPzoqcgfPhY BBFFl4Exlvzr8dXBPIf4zQXz4qONI2mrtCGSEseNmNGAYoEiVRZzhXF08DfI036Tynh3 jNjFXW6qTCjj7W8aZZxc73nPJWFrRzA0Zsi/fr3NNuNK7bBFFLAnc27nyLX4Evl9tM5s 8BuF/EQLgqVmDrIQXdIMqTd27+WNaDGAa6Rz5m41eo/kDvi2KcHC2tXGWNoCkFv2EalM M+D9mrXez1EOR+aL/6fvcACyGnyKBouN59TumczlM7sTlL5VCpHh2A4KYnkw3XE1tO3J cbhg== 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=tc2WgLkWhiOd2Da6oGGNq266lYDZJO4Qvh1o9bgNUOs=; b=n9WXfMg/BkOpmebipCB8LJlQItKx8kkOcS4YN9t7x+JW0sTRyveDc4UM97KlmL9VLk Z8D/QxZoR/nrAU9Ky5Rw4sr4bxMRk8Fa6gA7uGF7hoHLPB+T/XYEJwRit1STVmN8hmTo iEu3IiSqAgwVdkXh9H4928EdI3I+qVfWSDUeBNau5583hCBB9pVvRfxtY84XdWtGWnI8 oCfogqhMqs0gbX3urP05fbTAu8/exWv2nRScyJl/sbSdLPCIFJcOlTnJptxEWXPQy1PR GlOjdkbi13QbDUoOdSivasPkq8k3+R7Mh6QcZVizTLGTg+Ci++rw+bzyOPfFLe0aNFIo pcyQ== X-Gm-Message-State: ANhLgQ0jhzcszp1J2X/ZAEPMAwV62phT5HerlXlG2/DvuO4xd2b/YUt6 GgnBktXm6P0x8FANOdloeXngtEisiQMCfHx1S10RhmSqSqVQMQ== X-Google-Smtp-Source: ADFU+vvF6EoVSClKFZQ/kapPnE0C4B0BIXtgY0sn4FtoaP7+ggbgYIA4aRmyn5y6fY9Ldr/SBxZ29+qvwg5awfXiPXQ= X-Received: by 2002:aed:3c10:: with SMTP id t16mr5508440qte.45.1585431756091; Sat, 28 Mar 2020 14:42:36 -0700 (PDT) MIME-Version: 1.0 From: John Cowan Date: Sat, 28 Mar 2020 17:42:25 -0400 Message-ID: Content-Type: multipart/alternative; boundary="000000000000a3450a05a1f118f9" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::830 X-Spam-Score: 0.3 (/) 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: , X-List-Received-Date: Sat, 28 Mar 2020 21:42:40 -0000 --000000000000a3450a05a1f118f9 Content-Type: text/plain; charset="UTF-8" Interaction showing the problem $ guile GNU Guile 2.2.6 Copyright (C) 1995-2019 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (use-modules (system vm program)) scheme@(guile-user)> program-arities ERROR: Unbound variable: program-arities. ; should be defined Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user)> (arity:nreq +) ; 0 arguments required, correct $1 = 0 scheme@(guile-user)> (arity:rest? +) ; rest argument, correct $2 = #f scheme@(guile-user)> (arity:nreq car) ; 1 argument required, bad $3 = 0 scheme@(guile-user)> (program-arguments-alist car) ; correct $4 = ((required _) (optional) (keyword) (allow-other-keys? . #f) (rest . #f)) scheme@(guile-user)> The same thing happens in Guile 3, and on both Mac and Linux. --000000000000a3450a05a1f118f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Interaction showing the problem=


$ guile

GNU Guile 2.2.6

Copyright (C) 1995-2019 Free So= ftware Foundation, Inc.


Guile comes with ABSOLUTELY NO = WARRANTY; for details type `,show w'.

This program is free software, = and you are welcome to redistribute it

under certain conditions; type = `,show c' for details.


Enter `,help' for help.

scheme@(guile-user)> (use-mo= dules (system vm program))

scheme@(guile-user)> program= -arities

ERROR: Unbound variable: progra= m-arities. ; should be defined


Entering a new prompt.=C2=A0 Type `,bt' for a backt= race or `,q' to continue.

scheme@(guile-user)> (arity:nreq +) ; 0 argumen= ts required, correct

$1 =3D 0

scheme@(guile-user)> (arity:= rest? +) ; rest argument, correct

$2 =3D #f

scheme@(guile-user)> (arity:= nreq car) ; 1 argument required, bad

$3 =3D 0

scheme@(guile-user)> (progra= m-arguments-alist car) ; correct

$4 =3D ((required _) (optional)= (keyword) (allow-other-keys? . #f) (rest . #f))

scheme@(guile-user)><= /p>


The same thing happens in Guile 3, and on b= oth Mac and Linux.

--000000000000a3450a05a1f118f9-- From unknown Sat Jun 14 03:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40294: Documentation for arity procedures doesn't match behavior References: In-Reply-To: Resent-From: Taylan Kammer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 16 May 2021 00:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40294 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 40294@debbugs.gnu.org, John Cowan Received: via spool by 40294-submit@debbugs.gnu.org id=B40294.162112363223724 (code B ref 40294); Sun, 16 May 2021 00:08:02 +0000 Received: (at 40294) by debbugs.gnu.org; 16 May 2021 00:07:12 +0000 Received: from localhost ([127.0.0.1]:49427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li4JM-0006Aa-9o for submit@debbugs.gnu.org; Sat, 15 May 2021 20:07:12 -0400 Received: from mail-ej1-f42.google.com ([209.85.218.42]:42782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li4JK-0006AM-4P for 40294@debbugs.gnu.org; Sat, 15 May 2021 20:07:10 -0400 Received: by mail-ej1-f42.google.com with SMTP id lg14so3802675ejb.9 for <40294@debbugs.gnu.org>; Sat, 15 May 2021 17:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=hEywWM88EVzhl94HsK3P/9Pt4P7XEjVUUzaB8yZz7/4=; b=ZeZJ8D3Qv2tWLoOqCFofPU6AuFIGO8Gr28Dma/1HVx3dNlMAXrty3fh+SGwStzzGFf 8UUOs+d/PhLoeVhhleIn55P1O87jHkI8ws66IqeKU8dpEGTiGWaCBjU/st1fBfYt2UBf GbXrkEYWh+1rfoM1sWHi5HkVbAKkfPMvDMBF33yVX5GerdCLsS3iRfFnqPukbD1sa0xU yBatYFYSOmrYS2E85x3DNP1p31amepVtuh4XAThRqImLpmj1Vhpf4Oq/LDSSI26kgdN4 WQ4sLQQrX+9MJAVrasmVth6JoRbf2jV2E3aLkr2H0GwJi3zMQ31WAcLeEZMRbIX48wvr ZPwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=hEywWM88EVzhl94HsK3P/9Pt4P7XEjVUUzaB8yZz7/4=; b=cfI+HdZgKGqPWllwKIx7j0fKyq0vua+QLYmEDoxp9Rxw6IqN+crdcWmJMTXXMBx4yi Sf1YvJzr/p17IsTtFBQCMEZ3iIoPzSYTHEAmmXTt2ZbUEOzVeVU+Fp6T4V/JBYg71AIi oB8JRXjwxskWNi9DfExXr0NblODrC7ZJ4fYAggfeP0WGM5kbC0atmrcT49k27Gu2el7s vNYE/LW7yGm22fC9RG6SRSl+X7XI+EuQfV2rOIrbBXfVWJPQztSWhc7C8NXSKK7Y1ECJ qRPaVWP8wjGsjIgyA0oz7ZkJIJhvjIF3ZOt8KjOL3UUhCmoho4w06d/09g26p/Yl4QDj 6Pgw== X-Gm-Message-State: AOAM533k279lvaNmhmNvkIUrt63cqDIDVSHSQhvXdcKqcSDYzJI2Yg1f MuGxq0KxwUBsi/ikdqZLoDw= X-Google-Smtp-Source: ABdhPJwiN6GPjr9BilKuYZtkYMFBEmXEJdYuWVqaRA7ezKd6Eq12M8XInClMd399yEnwKxb4BCXzgA== X-Received: by 2002:a17:906:d8cb:: with SMTP id re11mr10232399ejb.482.1621123624201; Sat, 15 May 2021 17:07:04 -0700 (PDT) Received: from [192.168.178.20] (b2b-109-90-125-150.unitymedia.biz. [109.90.125.150]) by smtp.gmail.com with ESMTPSA id l11sm7692766eds.75.2021.05.15.17.07.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 May 2021 17:07:03 -0700 (PDT) From: Taylan Kammer Message-ID: Date: Sun, 16 May 2021 02:07:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) 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: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi John! I can't explain why program-arities isn't defined, but I can tell that you're not using the arity:foo procedures the way they're meant to, because their definition indicates that one is supposed to pass them some sort of arity object that is represented as a list. The implementations use 'match' to destructure their argument and the values you're getting correspond to the "else" branch of the match since you provide procedures as arguments instead of lists. (One could say the lack of type-checking is a bug on its own right here.) We seem to have no way of getting an arity list of this sort since program-arities isn't defined. I suspect that some corresponding C code was removed at some point and the module (system vm program) accidentally left in place, as the Scheme code begins with: (load-extension (string-append "libguile-" (effective-version)) "scm_init_programs") scm_init_programs is from libguile/programs.c and indeed it doesn't define program-arities. Will investigate more tomorrow. -- Taylan From unknown Sat Jun 14 03:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40294: Documentation for arity procedures doesn't match behavior Resent-From: Taylan Kammer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 16 May 2021 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40294 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 40294@debbugs.gnu.org, John Cowan Received: via spool by 40294-submit@debbugs.gnu.org id=B40294.1621178781975 (code B ref 40294); Sun, 16 May 2021 15:27:02 +0000 Received: (at 40294) by debbugs.gnu.org; 16 May 2021 15:26:21 +0000 Received: from localhost ([127.0.0.1]:51336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1liIer-0000Fe-3I for submit@debbugs.gnu.org; Sun, 16 May 2021 11:26:21 -0400 Received: from mail-ej1-f41.google.com ([209.85.218.41]:36772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1liIep-0000FQ-Lf for 40294@debbugs.gnu.org; Sun, 16 May 2021 11:26:19 -0400 Received: by mail-ej1-f41.google.com with SMTP id c20so5541053ejm.3 for <40294@debbugs.gnu.org>; Sun, 16 May 2021 08:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=7qPoGDshoNY01wPLrEwkEwD+Q6HcbV1WX/F/h5qVZNY=; b=sTwdI1oISf31q7KM+s1+1E12A+ImSMt5LYzaZeqXt0BZOFhJRb4MtNvdRGXzgpGKv8 KiQpbZ0pjffctXBByY0Nq12yjuK+I55eun8EuRRAnQjlmYBH5q5PkZHyMjFyuu1vw+rF DQ0Ku3g2IC/j79lXxcbISHtf+lUoqWe4XXlcxb6v8iGmBN86G1KCrc/U6ZcVtQY7TyoR 8uI+7lMtpmhmgOzzNV8kHodBnlQTLgGnCKPKecmCshiMdRwOCkDhJafHRZBIUgBximht /h8SQu1St2UD2SHfgIhebN1QtDFajxoZBPKfeDIghV972magEmlHLQsGd9H403JLqlBi tmRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7qPoGDshoNY01wPLrEwkEwD+Q6HcbV1WX/F/h5qVZNY=; b=OGFihFICPomwFGJ/NIXjlNXLOdK3AKN2caTR6EDbA2DkrlC00OgJ9axjCaOlb0qwqh CVjRYPNfX5+TtxPVpFg7b43S6/ppVS2+RphD3eaERStluxSOZUK+Z3lrWJWekF5kZCvM aSOS66KJhchRmlfqYZ4x800o6ltkpvuGB1I96VHh3VH9jvZZjXh0lfjhjX5jIul0uhKZ lctQVaTjdc5yjLk2k5O6jHcAdF7V8IIVMn0W3eJd2klP7OlZUYDrFv4QPBONIPg7axBg O63Q2zaEKvJ1ZXVZbQo6PoG7SUAuDn8ZoiNDZZk4C1U6GtG+yQezh/3yi+d5I0W8Q3yH JJzg== X-Gm-Message-State: AOAM532vSbPgzPEWA3hGccuClAiGuDjM5cgdYOpf8ZCViJEBQuuoVio5 pnlTUJU2wfpyw4eiExN8fDY= X-Google-Smtp-Source: ABdhPJwdoG37M0Im8PA1ryF+hx1rED22aydIycEHyJQq66sRLmL9jAcmTeAmO6KDuy3I6PQ+21IJtQ== X-Received: by 2002:a17:906:aac8:: with SMTP id kt8mr4474030ejb.402.1621178773855; Sun, 16 May 2021 08:26:13 -0700 (PDT) Received: from [192.168.178.20] (b2b-109-90-125-150.unitymedia.biz. [109.90.125.150]) by smtp.gmail.com with ESMTPSA id v12sm9336807edb.81.2021.05.16.08.26.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 May 2021 08:26:13 -0700 (PDT) From: Taylan Kammer References: Message-ID: <80122408-c057-c81c-dfe7-9afa7600854e@gmail.com> Date: Sun, 16 May 2021 17:26:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) 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: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 16.05.2021 02:07, Taylan Kammer wrote: > > Will investigate more tomorrow. > It seems that commit 1c33be992e8120abd20add8021e4d91d226f5b6a removed much of the programs API at the C level but forgot to make the changes to the corresponding Scheme module. (It was a big commit, part of changing the whole VM implementation.) I wonder if anyone really uses the program API. It might be best to deprecate it in favor of an improved procedure metadata API. -- Taylan