[Jprogramming] Evolution of a J code

Roger Hui RHui000 at shaw.ca
Fri Jan 6 13:47:35 HKT 2006


Pepe Quintana would tell you that there is no such example 
(that would absolutely require an explicit loop).  He does
everything tacitly, so there would be no explicit anything,
let alone an explicit loop.



----- Original Message ----- 
From: "Oleg Kobchenko" <olegykj at yahoo.com>
To: "Programming forum" <programming at jsoftware.com>
Sent: Thursday, January 05, 2006 9:31 PM
Subject: RE: [Jprogramming] Evolution of a J code

There are facilities in J to handle streams of data of
unknown length. For example, in the following problem:

   Value of coin toss trial is length of initial run of heads.
   Estimate maximum value in a series of N trials.

to simulate a trial, we can make a generator function
for a toss, which is called undetermined number of times
until first "tail". This looks like unknown amount of data.
However, it is possible to process it without explicit loops.

Practically, explicit loops may be preferred to gain
performance. However, in principle, I cannot think of
an example that would absolutely require an explicit loop.





More information about the Programming mailing list