Subject: forall, IF-THEN-ELSE

From: "Rex Page" <[email-masked]>
Date: Thu, 25 Jun 92 14:22:03 -0500

John Merlin says:
      If you introduce the conditional expressions for this case, then
      the other case, where you want S3 to use the *new* values computed by
      S1, can be expressed with the IF construct using its normal meaning:

 	FORALL ( I = 1 : N )
 	  IF ( A(I) < EPS ) THEN		! S0
 	    A(I) = 0.0				! S1
 	  ELSE
 	    A(I) = (A(I-1) + A(I+1)) / 2	! S3
 	  END IF
 	END FORALL

I don't think what John calls the normal meaning of IF makes sense in this
context.

FORALL is not a loop.  It is a bunch of statement-blocks being carried out
simultaneously (conceptually, at least).

  - Rex