Hello Joseph,
to be honest, this doesn't sound particularly like functional programming. The nice thing about functional programming is that you shouldn't care about such optimization stuff (like breaking out of a for loop), but instead our optimizer should be clever enough to stop executing the function once he has enough results. So simply request the first result and you should be fine. Something like this:
(for $a at $pos in $seq1 where $a = $seq2[$pos] return $a)[1]
Cheers
Dirk
On 02/27/2017 09:42 PM, Joseph wrote:
Hi,
I have two sets of numbers, and I would like to write a for-loop for comparison, so that I get only the first match between the numbers. I was thinking of a double for-loop, but I do not know how to exit the comparison as soon as I get the first match. Any idea? Thanks.
Joseph