From: | August Karlstrom <fusionfile@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Tue, 18 Jan 2011 16:00:13 +0100 |
Organization: | A noiseless patient Spider |
References: | 11-01-043 11-01-064 11-01-065 |
Keywords: | syntax, design, comment |
Posted-Date: | 18 Jan 2011 10:29:05 EST |
On 2011-01-16 21:09, Joshua Cranmer wrote:
> That said, there are other language constructs that I would like to see
> more commonly introduced, particularly the ability to go to different
> blocks if a while loop terminates early or not (think looking for an
> element in an array, and doing something only if you find one).
Do you think such a construct could make your example significantly
shorter or clearer than this?
i = 0;
while ((i < n) & (a[i] != x)) { /*search for x in a*/
i++;
}
if (i < n) { /*found*/
...
}
August
--
The competent programmer is fully aware of the limited size of his own
skull. He therefore approaches his task with full humility, and avoids
clever tricks like the plague. --Edsger Dijkstra
[Make the termination test more complex, and it gets pretty ugly. But
this is awfully close to arguing about where the semicolon goes. As
the prior message noted, break statements don't make loop analysis any
harder. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.