Re: Diamondback bites, fails to embrace Fuctional Programming concepts

From: Rudy Velthuis [TeamB] (velthuis_at_gmail.com)
Date: 09/14/04


Date: 14 Sep 2004 14:58:09 -0700

Michael Pence wrote:

> Right. Your code is equivalent. My point is that if the for...in
> construct is to save writing those tiresome blocks of code for
> traversing collections, why not take the next logical step and save
> more code by adding a where clause?

But it does not save more code. There is no big difference (except for
syntax) between

  for a in B where condition do

and

  for A in B do
    if condition then

The for...in loop saves you from having to get and set up an
IEnumerator and using MoveNext. The where clause does nothing of the
kind.

-- 
Rudy Velthuis [TeamB]
"Only one man ever understood me, and he didn't understand me."
 -- GW Hegel.


Relevant Pages

  • Re: Diamondback bites, fails to embrace Fuctional Programming concepts
    ... Michael Pence wrote: ... > construct is to save writing those tiresome blocks of code for ... > traversing collections, why not take the next logical step and save ...
    (borland.public.delphi.non-technical)
  • Re: Diamondback bites, fails to embrace Fuctional Programming concepts
    ... > construct is to save writing those tiresome blocks of code for ... > traversing collections, why not take the next logical step and save ...
    (borland.public.delphi.non-technical)
  • Re: shrivelled/shriveled
    ... I should be writing "that". ... clause, introduced by whether, if, that. ... Any idea what the different shades of meaning are? ...
    (alt.usage.english)
  • Re: shrivelled/shriveled
    ... I should be writing "that". ... clause, introduced by whether, if, that. ... Any idea what the different shades of meaning are? ...
    (alt.usage.english)
  • Re: JDBC & views
    ... > I know how to do it if I am writing the select statement. ... the user specified tablethen you will have to modify the user's ... statements appropriately before submitting them to the DB. ... corresponding view names in the statement's FROM clause. ...
    (comp.lang.java.programmer)