unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* srfi-1 delete proc arg order
@ 2003-05-10  3:59 Kevin Ryde
  2003-05-12 23:03 ` Kevin Ryde
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Ryde @ 2003-05-10  3:59 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

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.


[-- Attachment #2: srfi-1.scm.delete-args.diff --]
[-- Type: text/plain, Size: 279 bytes --]

--- 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))))))))
 

[-- Attachment #3: srfi-1.test.delete-args.diff --]
[-- Type: text/plain, Size: 464 bytes --]

--- 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
 ;;
 

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: srfi-1 delete proc arg order
  2003-05-10  3:59 srfi-1 delete proc arg order Kevin Ryde
@ 2003-05-12 23:03 ` Kevin Ryde
  2003-05-12 23:49   ` Rob Browning
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Ryde @ 2003-05-12 23:03 UTC (permalink / raw)


I wrote:
>
>         * srfi-1.scm (delete): Fix predicate arg order to match srfi-1 spec.
>         * tests/srfi-1.test (delete, delete!): Test predicate call arg order.

I applied this change to the head, someone else can make an executive
decision about the 1.6 branch.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: srfi-1 delete proc arg order
  2003-05-12 23:03 ` Kevin Ryde
@ 2003-05-12 23:49   ` Rob Browning
  2003-05-13 17:44     ` Marius Vollmer
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Browning @ 2003-05-12 23:49 UTC (permalink / raw)
  Cc: marius.vollmer

Kevin Ryde <user42@zip.com.au> writes:

> I applied this change to the head, someone else can make an
> executive decision about the 1.6 branch.

Marius, any opinion?  Technically it's a bug fix as measured against
the documentation, but if people have already accomodated this bug in
their code, and just not said anything, the change would mean breakage
for them...

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: srfi-1 delete proc arg order
  2003-05-12 23:49   ` Rob Browning
@ 2003-05-13 17:44     ` Marius Vollmer
  2003-05-16  1:06       ` Kevin Ryde
  0 siblings, 1 reply; 8+ messages in thread
From: Marius Vollmer @ 2003-05-13 17:44 UTC (permalink / raw)
  Cc: guile-devel

Rob Browning <rlb@defaultvalue.org> writes:

> Kevin Ryde <user42@zip.com.au> writes:
> 
> > I applied this change to the head, someone else can make an
> > executive decision about the 1.6 branch.
> 
> Marius, any opinion?  Technically it's a bug fix as measured against
> the documentation, but if people have already accomodated this bug in
> their code, and just not said anything, the change would mean breakage
> for them...

Tough call.  We just _can't_ offer a SRFI-1 that doesn't work like the
SRFI document says.  That would be silly.  It's also impossible to fix
this in a backwards compatible way.

The SRFI must win, so we have to break backwards compatability.

Kevin, please make the change in 1.6 as well and put a nice big note
at the top of NEWS.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: srfi-1 delete proc arg order
  2003-05-13 17:44     ` Marius Vollmer
@ 2003-05-16  1:06       ` Kevin Ryde
  2003-05-16  2:26         ` Rob Browning
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Ryde @ 2003-05-16  1:06 UTC (permalink / raw)


Marius Vollmer <mvo@zagadka.de> writes:
>
> The SRFI must win, so we have to break backwards compatability.

At least it wasn't specified in the guile docs, so hopefully noone
will depend on it.

> Kevin, please make the change in 1.6 as well and put a nice big note
> at the top of NEWS.

Done.

(I take it the branch NEWS gets copied to the head at a suitable time,
so I only added there.)


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: srfi-1 delete proc arg order
  2003-05-16  1:06       ` Kevin Ryde
@ 2003-05-16  2:26         ` Rob Browning
  2003-05-16 23:37           ` Kevin Ryde
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Browning @ 2003-05-16  2:26 UTC (permalink / raw)


Kevin Ryde <user42@zip.com.au> writes:

> At least it wasn't specified in the guile docs, so hopefully noone
> will depend on it.
>
>> Kevin, please make the change in 1.6 as well and put a nice big note
>> at the top of NEWS.
>
> Done.
>
> (I take it the branch NEWS gets copied to the head at a suitable time,
> so I only added there.)

Actually, not.  Any changes need to be applied to both trees since
they're completely separate, and may have differing sets of changes.
Also, any person coming back later, won't have made all the changes
listed and so may not be clear on which things should migrate.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: srfi-1 delete proc arg order
  2003-05-16  2:26         ` Rob Browning
@ 2003-05-16 23:37           ` Kevin Ryde
  2003-05-17  0:06             ` Rob Browning
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Ryde @ 2003-05-16 23:37 UTC (permalink / raw)


Rob Browning <rlb@defaultvalue.org> writes:
>
> Actually, not.  Any changes need to be applied to both trees since
> they're completely separate, and may have differing sets of changes.

I might be nice for users if the news looked like a single sequence,
even if it's not developed that way.  But anyway, I added to the head.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: srfi-1 delete proc arg order
  2003-05-16 23:37           ` Kevin Ryde
@ 2003-05-17  0:06             ` Rob Browning
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Browning @ 2003-05-17  0:06 UTC (permalink / raw)


Kevin Ryde <user42@zip.com.au> writes:

> I might be nice for users if the news looked like a single sequence,
> even if it's not developed that way.  But anyway, I added to the head.

True, to the extent possible, but we may do things in 1.6 that never
show up in 1.8...

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-05-17  0:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-10  3:59 srfi-1 delete proc arg order Kevin Ryde
2003-05-12 23:03 ` Kevin Ryde
2003-05-12 23:49   ` Rob Browning
2003-05-13 17:44     ` Marius Vollmer
2003-05-16  1:06       ` Kevin Ryde
2003-05-16  2:26         ` Rob Browning
2003-05-16 23:37           ` Kevin Ryde
2003-05-17  0:06             ` Rob Browning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).