Re: List to Chunks of size N

2020-03-05 Thread C K Kashyap
Nice! ... Thanks Alex, Regards, Kashyap On Wed, Mar 4, 2020 at 10:17 PM Alexander Burger wrote: > Hi Kashyap, > > > I've written a function to break a list into chunks of size N - > > > > (de Chunks (Lst N) > >(make > > (while Lst > > (link (head N Lst)) > > (cut N 'L

Re: List to Chunks of size N

2020-03-04 Thread Alexander Burger
Hi Kashyap, > I've written a function to break a list into chunks of size N - > > (de Chunks (Lst N) >(make > (while Lst > (link (head N Lst)) > (cut N 'Lst) ) ) ) This works, but 'head' and 'cut' both traverse the list, so the work is duplicated. Just 'cut' suffices.

List to Chunks of size N

2020-03-04 Thread C K Kashyap
Hi all, I've written a function to break a list into chunks of size N - (de Chunks (Lst N) (make (while Lst (link (head N Lst)) (cut N 'Lst) ) ) ) Does this look reasonable? Or am I missing something builtin? Regards, Kashyap