From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: srfi-1 delete proc arg order Date: Sat, 10 May 2003 13:59:19 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87issjqwo8.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1052539362 19182 80.91.224.249 (10 May 2003 04:02:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 10 May 2003 04:02:42 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat May 10 06:02:41 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19ELZJ-0004zG-00 for ; Sat, 10 May 2003 06:02:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19ELa4-000310-01 for guile-devel@m.gmane.org; Sat, 10 May 2003 00:03:28 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19ELZ3-0002ZU-00 for guile-devel@gnu.org; Sat, 10 May 2003 00:02:25 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19ELWn-0001Ff-00 for guile-devel@gnu.org; Sat, 10 May 2003 00:00:07 -0400 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19ELWL-00015o-00 for guile-devel@gnu.org; Fri, 09 May 2003 23:59:39 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) h4A3xSPc018236 for ; Sat, 10 May 2003 13:59:28 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h4A3xSQg023568 for ; Sat, 10 May 2003 13:59:28 +1000 (EST) Original-Received: from localhost (ppp22.dyn228.pacific.net.au [203.143.228.22]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h4A3xQYZ006600 for ; Sat, 10 May 2003 13:59:27 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19ELW3-0006sy-00; Sat, 10 May 2003 13:59:19 +1000 Original-To: guile-devel@gnu.org User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2320 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2320 --=-=-= I noticed the srfi-1 spec says delete and delete! call their predicate (proc x e[i]), but srfi/srfi-1.scm has it the other way around. The spec gives an example (delete 5 lst <) to remove all elements greater than 5 from lst, which doesn't work with the present code. Unless anyone knows a reason for this difference I'd suggest for head and stable, * srfi-1.scm (delete): Fix predicate arg order to match srfi-1 spec. * tests/srfi-1.test (delete, delete!): Test predicate call arg order. --=-=-= Content-Disposition: attachment; filename=srfi-1.scm.delete-args.diff --- srfi-1.scm.~1.23.~ 2003-05-05 11:23:36.000000000 +1000 +++ srfi-1.scm 2003-05-10 13:29:01.000000000 +1000 @@ -802,7 +802,7 @@ (let lp ((l list)) (if (null? l) '() - (if (l= (car l) x) + (if (l= x (car l)) (lp (cdr l)) (cons (car l) (lp (cdr l)))))))) --=-=-= Content-Disposition: attachment; filename=srfi-1.test.delete-args.diff --- srfi-1.test.~1.1.~ 2003-05-05 11:17:32.000000000 +1000 +++ srfi-1.test 2003-05-10 13:23:01.000000000 +1000 @@ -22,6 +22,22 @@ ;; +;; delete and delete! +;; + +(let () + (define (common-tests delete-proc) + (pass-if "called arg order" + (equal? '(1 2 3) + (delete-proc 3 '(1 2 3 4 5) <)))) + + (with-test-prefix "delete" + (common-tests delete)) + + (with-test-prefix "delete!" + (common-tests delete!))) + +;; ;; drop ;; --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--