GNU bug report logs - #72347
Mismatch between documentation and real implementation of list-index

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Marius <mariusgr@HIDDEN>; dated Mon, 29 Jul 2024 06:30:02 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at 72347 <at> debbugs.gnu.org:


Received: (at 72347) by debbugs.gnu.org; 29 Jul 2024 13:27:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 09:27:09 2024
Received: from localhost ([127.0.0.1]:45129 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sYQP7-0003x4-3I
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2024 09:27:09 -0400
Received: from layka.disroot.org ([178.21.23.139]:53486)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mariusgr@HIDDEN>) id 1sYQP2-0003wt-NI
 for 72347 <at> debbugs.gnu.org; Mon, 29 Jul 2024 09:27:07 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 5632A411E5;
 Mon, 29 Jul 2024 15:26:50 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 2Lv5h7g7t3OG; Mon, 29 Jul 2024 15:26:49 +0200 (CEST)
Date: Mon, 29 Jul 2024 13:26:44 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1722259609; bh=UwY8mkdn2d1rBU97I/myAs5XvVcRyussR/XHdk8AARI=;
 h=Date:From:To:CC:Subject:In-Reply-To:References;
 b=S6s7Kmk8QUS2dpwtIb+D6JTuui2hZfdlDxM636jJEsMmt6ZBFovFehZN6WPI8DL3x
 bRjAG1NsjceGPwITXtPUc5AsOBC3Eo3NjWvxCn27ljFHrCnRqQIntKXDQKDmEUZBd+
 DBAlE/KhLDzFP9mXo7i7WshYCXJFJLctvdRVi0vK6uNO2yG0/ISPzVbBHkSSWcYNOU
 cIbe+c9vSEV4kN00dlmIKN65A9x5/jsVyF4BkBPkm3PNxhjfsSe4WeMHcpQxu1TNbD
 ouKUE1RNIl7DYJdYJNU9wSmou8ByeaL+U9qRCDtjCG9TOu8A7o+iIbkAWdfAobsxbm
 vBrJHvFfC8c7g==
From: Marius <mariusgr@HIDDEN>
To: Tomas Volf <~@wolfsden.cz>
Subject: =?US-ASCII?Q?Re=3A_bug=2372347=3A_Mismatch_between_documenta?=
 =?US-ASCII?Q?tion_and_real_implementation_of_list-index?=
In-Reply-To: <ZqdusIZbWvs6NeH2@ws>
References: <18A0D20D-B19C-44AF-8BE7-486CE2DF6844@HIDDEN>
 <ZqdusIZbWvs6NeH2@ws>
Message-ID: <04C1F491-4AE7-46F4-88FC-B20ECF0752EB@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Autocrypt: addr=mariusgr@HIDDEN; keydata=
 mQINBGS1j68BEADba422smkwUlrzTfPMzt5Ac0k/9s6yRpREK/08LK1kMSq0Q+f5We95sQltvoK+
 oF9OJEllemyj4HK5Boj3N+IyGzSQwMyneM+BFAOHysU0Tmo0Kpu0Vro0plTV3xakyfi+wEkVwxVq
 3Jg9SyxzzNpFk0kOP3vzzZPtlic23vcBIzmOd/EFmxvPJ6QWAPC473neiqrEaIE1hJ6adOVP6vtt
 758zzgesSY3yOlBgc/GsOStGkNrNaujnx9vo9tXBDYyh0gqTwZRkUs7QFf1gVCs36V1kbKR8XqIU
 tpiJ/MrGuYQZ/Yz+MDEvLwv4BLKI/p+yFT+u6ORFYU4iYee1Iu3FKylK3f4OthxeJ3SPlVC6TR5Y
 O2GaFONesxCWf6phey05MbxwVmYLfLAly9KKsFww2+KFUReycBnx9l3Q8hBScWN7CoTN6r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Ivr4C0bQsbbb6UKo+nPECJH281xaOuzjOqxogz1lq6qfIw
 43OxXK0H43zOf2hl0Wd48xAuqtWzN5tvNq+BbkLZETUusqKNOVjX8C+DxgdYrtYwnQj8Oe05jYZS
 UF7ovOMmleoTCcfKgc1e2KkQ2n/E+8ihzZuW1TRboVLiNZi9AVHP2SQjZe+crVrixmNjhwfCruaf
 1vWfBn18b+OzR6JTPy6D/IzUDcty4xzL4Ixi9+OnMFLORh6hHkObe6u68OLq1ybNVcu1lgzTycEE
 Ouq9S+kVdnbp7dUmIbucSVE1Rp0aCc9Xvk8PZlg3RwGcIh54T66T8LKGwN/TbMUoXqjpgpaNGi4S
 kcjfHfMUn6QOZzc8+7xqiif8o05BHtTgK4aDHeh2HJD6BodiU6C9RD51JnHVZNjsXMSP/loY2XpS
 DtCHXiNq+Zho1Ckw7aOXzevuF1WMR/1kcsLboly3BNVem/57B39YKg7u2IhdJSTrOgGVxnZfZub0
 h34=
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72347
Cc: 72347 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Thank you for the quick response,

El 29 de julio de 2024 10:28:00 UTC, Tomas Volf <~@wolfsden=2Ecz> escribi=
=C3=B3:
>Hello,
>
>On 2024-07-29 00:34:14 +0000, Marius via Bug reports for GUILE, GNU's Ubi=
quitous Extension Language wrote:
>> Good evening,
>>
>> I don't know if this is actually a Guile bug or a documentation bug, bu=
t I'm currently learning Guile from the "Guile reference manual" and I've f=
ound a mismatch between what the documentation says and what "my" guile doe=
s=2E I use Guile 3=2E0=2E9=2E
>>
>> In my Guile instance (from what I can deduce), last-index is a procedur=
e that returns the index of the first element of a list that matches with a=
 s-expresion=2E
>>
>> For example:
>>
>> (list-index '(1 2 3) 3) -> 2
>> (list-index '(height width) 'width) -> 1
>>
>> But the documentation says otherwise (<https://www=2Egnu=2Eorg/software=
/guile//manual/guile=2Ehtml#SRFI_002d1-Filtering-and-Partitioning>):
>>
>> list-index pred lst1 lst2 =2E=2E=2E
>>
>> Returns the index of the first set of elements, one from each of lst1 l=
st2 =2E=2E=2E, which satisfies pred=2E
>
>This is documentation for SRFI-1, and that is not available by default (a=
t least
>not fully), you need to (use-modules) it=2E  See below=2E
>
>>
>>
>> If I try to run list-index examples (from the documentation) I get an e=
rror because it doesn't know how to deal with a procedure as the first argu=
ment=2E
>>
>>
>> I'm missing something? I understand that list-index it's defined in SRF=
I-1 and maybe a Guile definition is shadowing the SRFI-1 definition=2E But =
where is the Guile documentation for this shadowing list-index? In the Guil=
e Reference Manual list-index it's only described inside SRFI-1 module=2E
>
>It seems that Guile provides 2 different list-index procedures=2E  One de=
fined in
>the ice-9/boot-9=2Escm, and one in the srfi-1 module=2E  By default the b=
oot-9's one
>is available=2E
>
>    $ guile -q
>    GNU Guile 3=2E0=2E9
>    Copyright (C) 1995-2023 Free Software Foundation, Inc=2E
>
>    Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'=
=2E
>    This program is free software, and you are welcome to redistribute it
>    under certain conditions; type `,show c' for details=2E
>
>    Enter `,help' for help=2E
>    scheme@(guile-user)> list-index
>    $1 =3D #<procedure list-index (l k)>
>    scheme@(guile-user)> ,use (srfi srfi-1)
>    scheme@(guile-user)> list-index
>    $2 =3D #<procedure list-index (pred clist1 =2E rest)>
>
>Notice that by importing srfi-1 the list-index changes to the documented =
one=2E
>
>You are right that the "default" list-index indeed does not seem to be
>documented=2E  It also uses `eq?' for comparisons and does not allow chan=
ging
>that=2E
>
>I hope this sheds some light on the problem=2E
>
>Tomas

Yes, that makes sense=2E But this arises another question=2E The Guile man=
ual states that some SRFI procedures are native to Guile by default (I imag=
ine that that means that they are defined in ice-9/boot=2Escm)=2E This is e=
xplained in <https://www=2Egnu=2Eorg/software/guile/manual/guile=2Ehtml#Abo=
ut-SRFI-Usage> (section 7=2E5=2E1 in the manual)=2E All of this is in regar=
ds documentation:

In the manual there are procedures that are both explained in the their AP=
I reference section and in the SRFI section=2E When that is the case, it me=
ans that the guile default implementation (ice-9) differs from the SRFI (mo=
st of the time it's because of the order of arguments)=2E But if the proced=
ure it's ONLY present in the SRFI documentation part then it should mean th=
at it's implemented following the SRFI standard only, no?

The problem is that it seems like there are some procedures (named as in S=
RFI) that are implemented by default in guile (via ice-9 module) but aren't=
 documented in API reference section of the manual=2E Instead they are only=
 documented in the SRFI section of the manual=2E This is very confusing for=
 anyone using the Guile reference manual as a "reference manual" because yo=
u suddenly get procedures that do not follow the behavior that the manual i=
s telling you that should follow=2E

Again from the manual it's understood that if a procedure from SRFI is def=
ined in the default Guile (ice-9) then it's implemented following the SRFI =
standard (cite: "The second reason is that some features defined in SRFIs h=
ad been implemented in Guile before the developers started to add SRFI impl=
ementations as modules")=2E That's true unless in the API reference section=
 of the manual the procedure is defined in another way=2E

Since list-index is only documented in SRFI section but the default list-i=
ndex (ice-9) does not follow the SRFI convention then I still think this is=
 a bug=2E A documentation bug=2E Adding list-index inside the API documenta=
tion (list section) would solve this=2E Then it would be clear that the def=
ault list-index implementation differs from the SRFI=2E
>
>--
>There are only two hard things in Computer Science:
>cache invalidation, naming things and off-by-one errors=2E


Thank you,
Marius




Information forwarded to bug-guile@HIDDEN:
bug#72347; Package guile. Full text available.

Message received at 72347 <at> debbugs.gnu.org:


Received: (at 72347) by debbugs.gnu.org; 29 Jul 2024 10:28:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 06:28:27 2024
Received: from localhost ([127.0.0.1]:44929 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sYNcB-0007pY-03
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2024 06:28:27 -0400
Received: from wolfsden.cz ([37.205.8.62]:53334)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <~@wolfsden.cz>) id 1sYNc5-0007pK-TO
 for 72347 <at> debbugs.gnu.org; Mon, 29 Jul 2024 06:28:25 -0400
Received: by wolfsden.cz (Postfix, from userid 104)
 id 872E32912A2; Mon, 29 Jul 2024 10:28:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1722248886; bh=ds96s3387XeLOuj1Fv3mA9y+iP7DgQkBZKoINIjoalA=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=voZ1VcHsAfIk1DoiY/BZQhoWdYqOe/UBi1Soto9JgFecvBjVzJ/OwAEbIhX+k5Xjp
 vTyDz6/1mXUceB+O7GgUlJNsEuQmPNTqGyqtuNxFhwi3VJ7WtRQtl+s5i9tqVwjOuj
 qn+e5loxQk0frwybWrt8b4Q7aVTjxV018QcpY+7sCfLsdFX2+wJk8sG+PJQWQYxrpl
 Ct3NgaJq33kCipBuhMedD6qyaunRG0K6r4X1/mQJBOayQonuXa+zP/m0+xqnu48Lbm
 /yrqjj5Cdd7EInnJI765+NTq98WS+z+rbYffZwYEf1fyQLs1dDoyl9IvFADKTa9QRN
 Gnlfi380omoIsh7j1xT9uj5B3ocN7Z4sYPWIk/G2TV9168nKCazZkNSRNgKlO66o35
 e84Lo/FNrxjgzcyx0dcztR4djIP0QaVZq76sjN+RC5AtQt3sWXoSXcJpmhhQyx7Bkt
 H30Vw1LV9wUDzROpi4jlbvC+jGSPN0h+YEdql4eWK+3q6PYdtAJKoDXPa1A+t4zb9G
 9WD9ER27kUTD3GeqvL+tDErWKyGuOaNRekM3iql7OfKIT1Zj9HOkB3GBz7Tn6EnZHB
 JTR8BqNdlXMvKrJamSU821kGsWNw9DOSi/tdG9R5zsxan+6pQuMVffhC9ps5UG/Tti
 ZeFmFwGNE3C+h9uAjSgeiXjo=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=unavailable autolearn_force=no version=3.4.6
Received: from localhost (unknown [193.32.127.135])
 by wolfsden.cz (Postfix) with ESMTPSA id 57A0C291799;
 Mon, 29 Jul 2024 10:28:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1722248882; bh=ds96s3387XeLOuj1Fv3mA9y+iP7DgQkBZKoINIjoalA=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=Ms6Iu0CSSzArA3H1A4DUfniAsqsnMaUoVIlVDRiy6QBH50nt4+C7yRZ1aW5flULsF
 Wy+a/RbYAxjv5B1SYrvfHtL8gyyO/YIfiBF+Xr3Kt/KDPzFIDZWp8p6bR289lxqOAY
 kHw+tN0UcbwSmhOJkvdlUA1N1cFhjZJkCnNG11YzBr3Fu4bKxnaXi0T0opw3fZscGX
 eyAqU3VODGM+RcJPOfLvI5ExJwPEuwJV5EC0REzwfCFi90eyAxp6LUuVuIMEBFHTeP
 bDc0DKwbXurcBuR5oynRoFmFzDybIVPdGCRVi5yDacplejakpMH82ka7DwACssQ/rs
 FvYJ7LiIKFYvz29iUwo6/tk1Y5zM+DiFfAzPJQrNO14xV+rsrpb7aN6rLVlPOIO/RX
 2dQsvIoFFGTyclGeNQ2CBni2yBMzBfq4wGAkPw/4yGFk13fZr9yoRS6EHQyMBKg2ej
 OUf5nhSExXQFssS9uID+SFZiltuiE5OEJGM0bTbcOR1wbey/xhWRun9ryDaZG1YBTl
 vnswI3rfmMq4QJ/+1ZP1julv06ASmjDWYaVkFpxGcd8oaOE3AAZ3fxJVAaN3GI6oOf
 yDGTftC/KuBhjiZtn21DLfgkQ07Vc1thvT2EZ20Ns4IAXy9HnAnMytGXhr5uhIFKGf
 2K269NLIRJ0N5gTAp7FkTE/4=
Date: Mon, 29 Jul 2024 12:28:00 +0200
From: Tomas Volf <~@wolfsden.cz>
To: Marius <mariusgr@HIDDEN>
Subject: Re: bug#72347: Mismatch between documentation and real
 implementation of list-index
Message-ID: <ZqdusIZbWvs6NeH2@ws>
References: <18A0D20D-B19C-44AF-8BE7-486CE2DF6844@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="E3OzkoWqjR5K6Z1S"
Content-Disposition: inline
In-Reply-To: <18A0D20D-B19C-44AF-8BE7-486CE2DF6844@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 72347
Cc: 72347 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--E3OzkoWqjR5K6Z1S
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

On 2024-07-29 00:34:14 +0000, Marius via Bug reports for GUILE, GNU's Ubiquitous Extension Language wrote:
> Good evening,
>
> I don't know if this is actually a Guile bug or a documentation bug, but I'm currently learning Guile from the "Guile reference manual" and I've found a mismatch between what the documentation says and what "my" guile does. I use Guile 3.0.9.
>
> In my Guile instance (from what I can deduce), last-index is a procedure that returns the index of the first element of a list that matches with a s-expresion.
>
> For example:
>
> (list-index '(1 2 3) 3) -> 2
> (list-index '(height width) 'width) -> 1
>
> But the documentation says otherwise (<https://www.gnu.org/software/guile//manual/guile.html#SRFI_002d1-Filtering-and-Partitioning>):
>
> list-index pred lst1 lst2 ...
>
> Returns the index of the first set of elements, one from each of lst1 lst2 ..., which satisfies pred.

This is documentation for SRFI-1, and that is not available by default (at least
not fully), you need to (use-modules) it.  See below.

>
>
> If I try to run list-index examples (from the documentation) I get an error because it doesn't know how to deal with a procedure as the first argument.
>
>
> I'm missing something? I understand that list-index it's defined in SRFI-1 and maybe a Guile definition is shadowing the SRFI-1 definition. But where is the Guile documentation for this shadowing list-index? In the Guile Reference Manual list-index it's only described inside SRFI-1 module.

It seems that Guile provides 2 different list-index procedures.  One defined in
the ice-9/boot-9.scm, and one in the srfi-1 module.  By default the boot-9's one
is available.

    $ guile -q
    GNU Guile 3.0.9
    Copyright (C) 1995-2023 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)> list-index
    $1 = #<procedure list-index (l k)>
    scheme@(guile-user)> ,use (srfi srfi-1)
    scheme@(guile-user)> list-index
    $2 = #<procedure list-index (pred clist1 . rest)>

Notice that by importing srfi-1 the list-index changes to the documented one.

You are right that the "default" list-index indeed does not seem to be
documented.  It also uses `eq?' for comparisons and does not allow changing
that.

I hope this sheds some light on the problem.

Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--E3OzkoWqjR5K6Z1S
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmanbrAACgkQL7/ufbZ/
wakj7RAAkiu1XLillP0+NAJQ4tBVUErWI/zTs9O1ohZ0fl4l8oQK8lRGWkSLeaSn
PWnQFYfnFJpmbp/HCd+DE2bgxLWLm8gw0B6PtP9UUv9Vzx+j335inSIF3658SM7o
8KDxh3Wv1WhbQSDGanerOp5YqLoJ8owiOqXvQ3Fz6lNF2y7uvBt7EdL2FCzlVkID
w6SoKOd6FdUwU2GgLHpvEoUy/C1rRBQlDm8lU8fk95KL/Y5r7X7eLWc10uscp1Qr
mH6dMT12NhmrZurepyBkjmLPEI+rnuBupchbCzZV+MfwQbL1qdmIx8jlNa8fCgeT
0wMs8ebI2DoMgvwRngpyuLIeX5P6DjDoQJNPmvQtXcKA6sosY8cSZI/4/GiBfo5x
4rmUhUAvdCLOilWeLtZ20a82TcOhYJ1PBMRdtkfIPzsUfOJjkTHbUR42wC+ieRr5
oUAraJxpStXvLCewJ6+Sak+uMxLZ/sxzROMhGhiu/tgmBQ3rWCfK9zPCDnqNRVOW
/E2458ip+mombAbHAzFPzI1zceX/sn2IP6lMnx/zqiIPLP+wGPgY6HadermJnr/y
RbyYggKpdHviPfRuZ9Zy6kuMb4MRkaA8VsDRBrPk1cXgETBzsKZDG9UjZjaFE/hE
nH6yYmX+JIsTjLjtk4rH6WVg2FJPeWeySnVh+rk3gWPM8kX/QMg=
=Wj++
-----END PGP SIGNATURE-----

--E3OzkoWqjR5K6Z1S--




Information forwarded to bug-guile@HIDDEN:
bug#72347; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Jul 2024 06:29:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 02:29:53 2024
Received: from localhost ([127.0.0.1]:44771 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sYJtG-0001ax-Cf
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2024 02:29:53 -0400
Received: from lists.gnu.org ([209.51.188.17]:42820)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mariusgr@HIDDEN>) id 1sYELW-0000nf-Qo
 for submit <at> debbugs.gnu.org; Sun, 28 Jul 2024 20:34:40 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mariusgr@HIDDEN>)
 id 1sYELH-0007pr-TL
 for bug-guile@HIDDEN; Sun, 28 Jul 2024 20:34:25 -0400
Received: from layka.disroot.org ([178.21.23.139])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <mariusgr@HIDDEN>)
 id 1sYELF-0006EE-Kx
 for bug-guile@HIDDEN; Sun, 28 Jul 2024 20:34:23 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id E147541093
 for <bug-guile@HIDDEN>; Mon, 29 Jul 2024 02:34:17 +0200 (CEST)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id zyOggWRzLy8o for <bug-guile@HIDDEN>;
 Mon, 29 Jul 2024 02:34:16 +0200 (CEST)
Date: Mon, 29 Jul 2024 00:34:14 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1722213256; bh=ah8FtfmGijL2YoMQaA1RWMJ6yuXKt8qTGSt1DZ4iH+g=;
 h=Date:From:To:Subject;
 b=c/psb5oW0jJ490NxCEYEwtLUZOBhJkwxLC083QkXYavmNVRdHQ2Vve0epDeav4XS3
 4SRnouU6dSXRU1f+HN9fRM5Jd84LCHi8SgqCNqZKLZ/PTDTu1wpuY2CBgIB8/z1TOV
 BYZ64GiNgCjs2cIbvpfM0a9+VFuDirwtjaYpDjnaWXMvKmnEpH4DNwzwGIwyNO6kol
 PceVauYRVYy6vaFLXJdEKGd5Wtx1/C0kWZvIiO/tiXsQcXIRcePi4wq7ZkVMm8K9tH
 XKlgYzNbEpR130n8RZmXNsVynMw4Gqvrl4Aon/N59hFCVVoWROndmF7tImwB4pxq/l
 xbf98nJQINOaQ==
From: Marius <mariusgr@HIDDEN>
To: bug-guile@HIDDEN
Subject: Mismatch between documentation and real implementation of list-index
Message-ID: <18A0D20D-B19C-44AF-8BE7-486CE2DF6844@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary=----9M2U8DRVWE37VAXSQZ14Y0B1PTDAJQ
Content-Transfer-Encoding: 7bit
Autocrypt: addr=mariusgr@HIDDEN; keydata=
 mQINBGS1j68BEADba422smkwUlrzTfPMzt5Ac0k/9s6yRpREK/08LK1kMSq0Q+f5We95sQltvoK+
 oF9OJEllemyj4HK5Boj3N+IyGzSQwMyneM+BFAOHysU0Tmo0Kpu0Vro0plTV3xakyfi+wEkVwxVq
 3Jg9SyxzzNpFk0kOP3vzzZPtlic23vcBIzmOd/EFmxvPJ6QWAPC473neiqrEaIE1hJ6adOVP6vtt
 758zzgesSY3yOlBgc/GsOStGkNrNaujnx9vo9tXBDYyh0gqTwZRkUs7QFf1gVCs36V1kbKR8XqIU
 tpiJ/MrGuYQZ/Yz+MDEvLwv4BLKI/p+yFT+u6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JRDWusGb2j/svzy4WnxtdLWVoIwopGnbJ+jjShLxV0cm/LDA6v1/4eD3gdAjxCpY1B9T9PckYevO
 LM/2ZZqcqR6FSBhC0aK8RytKgtC809Ivr4C0bQsbbb6UKo+nPECJH281xaOuzjOqxogz1lq6qfIw
 43OxXK0H43zOf2hl0Wd48xAuqtWzN5tvNq+BbkLZETUusqKNOVjX8C+DxgdYrtYwnQj8Oe05jYZS
 UF7ovOMmleoTCcfKgc1e2KkQ2n/E+8ihzZuW1TRboVLiNZi9AVHP2SQjZe+crVrixmNjhwfCruaf
 1vWfBn18b+OzR6JTPy6D/IzUDcty4xzL4Ixi9+OnMFLORh6hHkObe6u68OLq1ybNVcu1lgzTycEE
 Ouq9S+kVdnbp7dUmIbucSVE1Rp0aCc9Xvk8PZlg3RwGcIh54T66T8LKGwN/TbMUoXqjpgpaNGi4S
 kcjfHfMUn6QOZzc8+7xqiif8o05BHtTgK4aDHeh2HJD6BodiU6C9RD51JnHVZNjsXMSP/loY2XpS
 DtCHXiNq+Zho1Ckw7aOXzevuF1WMR/1kcsLboly3BNVem/57B39YKg7u2IhdJSTrOgGVxnZfZub0
 h34=
Received-SPF: pass client-ip=178.21.23.139; envelope-from=mariusgr@HIDDEN;
 helo=layka.disroot.org
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 29 Jul 2024 02:29:49 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

------9M2U8DRVWE37VAXSQZ14Y0B1PTDAJQ
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

Good evening,

I don't know if this is actually a Guile bug or a documentation bug, but I=
'm currently learning Guile from the "Guile reference manual" and I've foun=
d a mismatch between what the documentation says and what "my" guile does=
=2E I use Guile 3=2E0=2E9=2E

In my Guile instance (from what I can deduce), last-index is a procedure t=
hat returns the index of the first element of a list that matches with a s-=
expresion=2E

For example:

(list-index '(1 2 3) 3) -> 2
(list-index '(height width) 'width) -> 1

But the documentation says otherwise (<https://www=2Egnu=2Eorg/software/gu=
ile//manual/guile=2Ehtml#SRFI_002d1-Filtering-and-Partitioning>):

list-index pred lst1 lst2 =2E=2E=2E

Returns the index of the first set of elements, one from each of lst1 lst2=
 =2E=2E=2E, which satisfies pred=2E


If I try to run list-index examples (from the documentation) I get an erro=
r because it doesn't know how to deal with a procedure as the first argumen=
t=2E


I'm missing something? I understand that list-index it's defined in SRFI-1=
 and maybe a Guile definition is shadowing the SRFI-1 definition=2E But whe=
re is the Guile documentation for this shadowing list-index? In the Guile R=
eference Manual list-index it's only described inside SRFI-1 module=2E



Thank you for your help=2E

Forgive me for any inconvenience,
Marius=2E



------9M2U8DRVWE37VAXSQZ14Y0B1PTDAJQ
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html><html><body><div dir=3D"auto">Good evening,<br><br>I don't k=
now if this is actually a Guile bug or a documentation bug, but I'm current=
ly learning Guile from the "Guile reference manual" and I've found a mismat=
ch between what the documentation says and what "my" guile does=2E I use Gu=
ile 3=2E0=2E9=2E<br><br>In my Guile instance (from what I can deduce), last=
-index is a procedure that returns the index of the first element of a list=
 that matches with a s-expresion=2E<br><br>For example:<br><br>(list-index =
'(1 2 3) 3) -&gt; 2<br>(list-index '(height width) 'width) -&gt; 1<br><br>B=
ut the documentation says otherwise (&lt;<a href=3D"https://www=2Egnu=2Eorg=
/software/guile//manual/guile=2Ehtml#SRFI_002d1-Filtering-and-Partitioning"=
>https://www=2Egnu=2Eorg/software/guile//manual/guile=2Ehtml#SRFI_002d1-Fil=
tering-and-Partitioning</a>&gt;):<br><br>list-index pred lst1 lst2 =2E=2E=
=2E<br><br>Returns the index of the first set of elements, one from each of=
 lst1 lst2 =2E=2E=2E, which satisfies pred=2E<br><br><br>If I try to run li=
st-index examples (from the documentation) I get an error because it doesn'=
t know how to deal with a procedure as the first argument=2E<br><br><br>I'm=
 missing something? I understand that list-index it's defined in SRFI-1 and=
 maybe a Guile definition is shadowing the SRFI-1 definition=2E But where i=
s the Guile documentation for this shadowing list-index? In the Guile Refer=
ence Manual list-index it's only described inside SRFI-1 module=2E<br><br><=
br><br>Thank you for your help=2E<br><br>Forgive me for any inconvenience,<=
br>Marius=2E<br><br><br></div></body></html>
------9M2U8DRVWE37VAXSQZ14Y0B1PTDAJQ--




Acknowledgement sent to Marius <mariusgr@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#72347; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

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