> Semantic confusion alert!

Aroogha! Aroogha! All crew to clarification stations!


   > EX3 (great document!)

Thank-you.

   
   > sez:
   > 
   > >       print "Inflation rate: " and $inflation = +<>
   > >                             until $inflation != NaN;
   > 
   > This requires that C<NaN != NaN> be false, causing the loop to continue
   > until a valid numeric string is entered.

Err. Are you *sure*? That's an C<until>, not a C<while>, you realize?
   
   
   > The example can be rewritten
   > 
   >        print "Inflation rate: " and $inflation = +<>
   >                              while $inflation != $inflation;

Err. No it can't.

   
   > That is ugly, non-intuitive and ugly; and non-intuitive too. But
   > inconsistency with a long accepted standard is also ungood. Perhaps we
   > need to write it thus:
   > 
   >        print "Inflation rate: " and $inflation = +<>
   >                              while $inflation.isnan;
   > 
   > or some such?

Or:

            print "Inflation rate: " and $inflation = +<>
                                  while $inflation == NaN;

which is:

            print "Inflation rate: " and $inflation = +<>
                                  while !($inflation != NaN);

which is:

            print "Inflation rate: " and $inflation = +<>
                                  until ($inflation != NaN);

which is exactly what I wrote.

;-)

Damian

Reply via email to