[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Map and filter without intermediate tables
- From: joao lobato <btnfdp.lobato@...>
- Date: Thu, 7 Jun 2012 17:59:49 +0100
On 6/7/12, Peter Cawley <lua@corsix.org> wrote:
> On Thu, Jun 7, 2012 at 3:02 PM, joao lobato <btnfdp.lobato@gmail.com>
> wrote:
>> You can't break out of that for-loop. Those kind of constraints shape
>> your
>> solutions in ways that can easily make them suboptimal both in
>> time/memory
>> and ease of reading.
>
> On the flip side, knowing that you cannot break out could make it
> easier to read. A general for-loop could do all sorts of odd things,
> so you (in general) need to read the entire body to understand what
> might happen. For more specialised / sugared types of loop, reading
> the header is sufficient to understand that nothing crazy is going to
> happen.
>
>
Yes, I had not considered that. However, I believe that is valid only
for "small" examples where unsurprising things are accomplished. I
guess one could very easily understand Quicksort defined as a list
expression. It's perfect to explain the algorithm to someone, but you
would not want to use it to sort a big list.
- References:
- Map and filter without intermediate tables, Geoff Leyland
- Re: Map and filter without intermediate tables, joao lobato
- Re: Map and filter without intermediate tables, Geoff Leyland
- Re: Map and filter without intermediate tables, joao lobato
- Re: Map and filter without intermediate tables, Geoff Leyland
- Re: Map and filter without intermediate tables, steve donovan
- Re: Map and filter without intermediate tables, joao lobato
- Re: Map and filter without intermediate tables, steve donovan
- Re: Map and filter without intermediate tables, joao lobato
- Re: Map and filter without intermediate tables, Peter Cawley