Hi, thank you very much for the submission, it is greatly appreciated.
We received a second one by IRC, and I plan to compare the two (and maybe benchmark), and then take the better and/or faster. Cheers, Moritz On 10/09/2010 11:58 AM, Karthik wrote: > This is my first try at coding in perl6. I did not understand the part > in the spec that talks about random splicing of common whitespace chars. > > augment class Str { > method samespace($other as Str) { > my @self_ws = self.comb(/s+/); > my @other_ws = $other.comb(/s+/); > my @self_nws = self.split(/s+/); > if (@self_nws.elems >= @other_ws.elems) { > (@self_nws Z (@other_ws, @self_...@other_ws.elems..(@self_ws.elems-1)], > "")).join(""); > } else { > (@self_nws Z (@other_ws[0..(@self_nws.elems-2)]), "").join(""); > } > } > } > > > -- > Karb > <http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline....@middle?> >