This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: remove! bug


Sorry I should have explained more in the previous post.
The bug is that remove! is unable to remove the first element of the
list that satisfy the predicate.
the first element ('a 1) was not removed from list1 while the second
element ('b 2) was removed successfully.

Is that normal or is that a bug?

On Fri, May 28, 2010 at 10:08 PM, teong leong chuah
<teongleong@gmail.com> wrote:
> I believe I have found a bug in the remove! procedure of the list-lib
> implemented in kawa
>
> consider the following:
> ?(define list1
> ? ?(list (list 'a 1) (list 'b 2) (list 'c 3)))
>
> ?(define list2
> ? ?(list (list 'a 1) (list 'b 2) (list 'c 3)))
>
> ?(remove! (lambda (x) (equal? (car x) 'b)) list1)
> ?(remove! (lambda (x) (equal? (car x) 'a)) list2)
> ?(display "list 1 ")(display list1 )(newline)
> ?(display "list 2 ")(display list2) (newline)
>
> output:
>
> list 1 ((a 1) (c 3))
> list 2 ((a 1) (b 2) (c 3))
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]