GNU bug report logs - #40294
Documentation for arity procedures doesn't match behavior

Previous Next

Package: guile;

Reported by: John Cowan <cowan <at> ccil.org>

Date: Mon, 30 Mar 2020 02:36:07 UTC

Severity: minor

Full log


View this message in rfc822 format

From: Taylan Kammer <taylan.kammer <at> gmail.com>
To: 40294 <at> debbugs.gnu.org, John Cowan <cowan <at> ccil.org>
Subject: bug#40294: Documentation for arity procedures doesn't match behavior
Date: Sun, 16 May 2021 02:07:02 +0200
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




This bug report was last modified 4 years and 29 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.