Talk:Order disjoint list items: Difference between revisions

→‎Perl 6 entry: regarding members of N not in M
(→‎Perl 6 entry: regarding members of N not in M)
Line 7:
 
Edit: and <tt>M = <A X></tt> and <tt>N = <Y A></tt> for that matter. --[[User:Ledrug|Ledrug]] ([[User talk:Ledrug|talk]]) 02:20, 13 May 2014 (UTC)
 
:I've added the requested cases; you'll note that the solution to A X ==> Y A assumes (reasonably, I think) that the N list elements are a subset of the M elements, as the task postulates without commentary on violations. The reason I think this assumption is okay is that it scales well to arbitrarily long M lists (indeed, Perl 6 could apply this function lazily to an infinitely long M list, though of course it can't work with an infinitely long N list due to the necessity of testing set/bag membership). We tend to avoid solutions that require an unnecessary prescan of a list for this reason, and it would take such an "unnecessary" prescan of M to enforce set membership in the other direction. In any case, whether or not your language supports infinite lists, it's extra work, and prevents the function from being used to substitute a list of words that weren't in the original, which seem like a kind of arbitrary restriction from a practical point of view. --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 04:40, 13 May 2014 (UTC)
Anonymous user