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 forcomparison, so that I get only the first match between the numbers. Iwas thinking of a double for-loop, but I do not know how to exit thecomparison as soon as I get the first match. Any idea? Thanks.Joseph
--
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22