[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Compress a sequence of ends
- From: "Pascal J. Bourguignon" <pjb@...>
- Date: Fri, 22 Jul 2011 02:21:54 +0200
David Manura <dm.lua@math2.org> writes:
> On Thu, Jul 21, 2011 at 4:04 AM, Dirk Laurie <dpl@sun.ac.za> wrote:
>> On the other hand, if a loop and a conditional, or nested loops,
>> have the same body, I write as a habit
>> for i=1,n if x[i]~=0
>> -- (body)
>> end end
>
> I also commonly do things like
>
> for k=1, 10 do
> for j=1, 10 do
> for i=1, 10 do
> f(i, j, k)
> end end end
>
> Replacing `end end end` with `ennnd` or (preferably) `end3` is not
> going to gain much.
I've got an idea. Let's use a single character, instead of a keyword
here.
(for k=1, 10 do
(for j=1, 10 do
(for i=1, 10 do
f(i, j, k)
)))
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.