[Jprogramming] find first element satisfying predicate?

2013-07-06 Thread Alexander Mikhailov
How to find first element of array which satisfies the given predicate? I'm asking because I wonder how to implement it efficiently. An array could be very long, say a billion elements, and chances are the first element satisfying a certain predicate may almost certainly be found in first, say

[Jprogramming] parsing with J, cont.

2012-11-16 Thread Alexander Mikhailov
> Note that Context Free Grammars tend to be ambiguous, in traditional > programming environments we typically want a Parsing Expression > Grammar. And we probably need "cloud sized resources" to adequately > tackle natural language parsing. I have only little familiarity with PEGs; I'm not sure

[Jprogramming] parsing with J, cont.

2012-11-15 Thread Alexander Mikhailov
Regarding http://www.jsoftware.com/jwiki/AlexMikhailov/Parsing There are multiple questions regarding J style. For example, it seems like it would be awfully inefficient to try to solve parsing problem in parallel - avoiding the loop. On the other hand, in highly parallel environment with

[Jprogramming] parsing with J

2012-11-15 Thread Alexander Mikhailov
Hi, I wrote an EBNF parser with some explanations here - http://www.jsoftware.com/jwiki/AlexMikhailov/Parsing . I'd really like to hear comments on the approach taken for algorithm and implementation. Particularly, how properties of J can better be used for tasks like that. I intend to cont