Re: string/list division

2005-03-29 Thread Luke Palmer
Aaron Sherman writes: > On Mon, 2005-03-28 at 13:38, Luke Palmer wrote: > > > Your "list mod" idea is interesting, though. I fear that adding too > > many list operators will start to make us look like Haskell, where we > > have *extremely* expressive single lines that take an hour to write and >

Re: string/list division

2005-03-28 Thread Aaron Sherman
On Mon, 2005-03-28 at 13:38, Luke Palmer wrote: > Your "list mod" idea is interesting, though. I fear that adding too > many list operators will start to make us look like Haskell, where we > have *extremely* expressive single lines that take an hour to write and > an hour to read (I call this "c

Re: string/list division

2005-03-28 Thread Luke Palmer
Juerd writes: > What if instead of > > my @copy = @array; > while (my @chunk = splice @copy, 0, $chunksize) { > ... > } # ^1 Well, I for one never write that. I very seldom use splice. > > we could just write > > for @array [/] $chunksize -> @chunk { ... } Well, we c

string/list division

2005-03-28 Thread Juerd
It was a matter of time, of course, after my last thread. How often do we want chunks of a string or list? And how often do we abuse a temporary copy and substr/splice for that? What if instead of my @copy = @array; while (my @chunk = splice @copy, 0, $chunksize) { ... } # ^