Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - tadeas

#1
newLISP in the real world / Re: Intersect bug
March 04, 2014, 09:30:59 AM
Very well, this is not a bug.



I made two mistakes:

1) I didn't properly read intersect documentation so I expected it to do something a bit different.

2) I didn't realize that the algebraic intersection doesn't really make sense on lists with the same element more times.



I'm sorry guys.
#2
newLISP in the real world / Re: Intersect bug
March 04, 2014, 02:47:24 AM
Now that I read intersect documentation again it looks like this behavior is correct.
QuoteIn the second syntax, intersect returns a list of all elements in list-A that are also in list-B, without eliminating duplicates in list-A


But, then, intersect function is not doing an intersection (on the other hand nobody says it should). From what I remember from studies, intersection of {1 2 2 2 3} and {2 2} is unambiguously {2 2} .
#3
newLISP in the real world / Intersect bug
March 04, 2014, 12:38:43 AM
Hi, if there's a dedicated bug tracker for newLISP please let me know and I'll repost it there.



There's a bug in intersect function:



$ newlisp
newLISP v.10.5.4 64-bit on OSX IPv4/6 UTF-8, options: newlisp -h

> (set 'a '(2 2))
(2 2)
> (set 'b '(2 2 2))
(2 2 2)
> (intersect a b true)
(2 2)
> (intersect b a true)
(2 2 2)