From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.devel Subject: Re: (list-head lst k) with k longer than (length lst) Date: Tue, 17 Nov 2015 13:44:25 +0000 Message-ID: <20151117134425.60061f76@bother.homenet> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1447767904 4966 80.91.229.3 (17 Nov 2015 13:45:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 13:45:04 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Nov 17 14:44:57 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZygZ6-00051e-TM for guile-devel@m.gmane.org; Tue, 17 Nov 2015 14:44:57 +0100 Original-Received: from localhost ([::1]:58528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZygZ6-0005n0-7a for guile-devel@m.gmane.org; Tue, 17 Nov 2015 08:44:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZygYg-00057w-C6 for guile-devel@gnu.org; Tue, 17 Nov 2015 08:44:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZygYc-0004kI-Ae for guile-devel@gnu.org; Tue, 17 Nov 2015 08:44:30 -0500 Original-Received: from smtpout1.wanadoo.co.uk ([80.12.242.29]:30290 helo=smtpout.wanadoo.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZygYc-0004jx-4w for guile-devel@gnu.org; Tue, 17 Nov 2015 08:44:26 -0500 Original-Received: from bother.homenet ([2.25.43.62]) by mwinf5d15 with ME id idkQ1r0081LUlWi03dkQuw; Tue, 17 Nov 2015 14:44:24 +0100 X-ME-Helo: bother.homenet X-ME-Date: Tue, 17 Nov 2015 14:44:24 +0100 X-ME-IP: 2.25.43.62 Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with ESMTP id 35B1384920 for ; Tue, 17 Nov 2015 13:44:25 +0000 (GMT) In-Reply-To: X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.29 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:18030 Archived-At: On Tue, 17 Nov 2015 11:53:05 +0100 Jan Syn=C3=A1=C4=8Dek wrote: > Hello, >=20 > I'm getting: >=20 > scheme@(guile-user)> (list-head '(1 2 3) 5) > ERROR: In procedure list-head: > ERROR: In procedure list-head: Wrong type argument in position 1 > (expecting pair): () >=20 > This looks pretty much like a bug to me. Shouldn't list-head return > the entire list when the 'k' is bigger than its length? If that is not > the case, at least the error is really confusing. I'm using Guile > 2.0.11. The error message is confusing, but I guess the behaviour of list-head mirrors R5RS list-tail: instead of mandating the return of an empty list, R5RS states that "It is an error if list has fewer than k elements". Chris