On Thu Aug 27 03:06:07 2015, coke wrote: > On Sat Mar 28 16:15:48 2015, esteiner wrote: > > According to its definition, squish should always return at least the > > first list element in the result list, no matter what &with returns. > > > > Currently it can happen that squish returns an empty list if &with > > returns true on the first comparison: > > > > This is perl6 version 2015.03 built on MoarVM version 2015.03 > > > > > > > <a a>.squish(:with(-> $a, $b {1})).perl.say > > ().list > > > > This works with unique: > > > > > <a a>.unique(:with(-> $a, $b {1})).perl.say > > ("a",).list > > I don't see this in the synopses, but only in the test file, and it > looks like the tests were originally added after this ticket was > opened. Can we get a ruling as to whether this is required? (Or a > pointer to something in the Syn?)
I think the relevant sentence from S32/Containers.html is "Returns a list of values from the invocant/argument list where runs of more than one value are replaced with only the first instance." AFAIU .squish is not meant to wipe out all values -- regardless of the comparison function provided via :with. The bug report looks valid to me. For the records: :with was added to the design docs with commit ec1b7c619d (which has a link to the IRC logs) and was removed less than 24 hours later (c313c2918e). It was implemented for Rakudo with commit 8d851b7831.