comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Two "parallel" iterators
Date: Tue, 12 Sep 2017 00:56:13 +0300
Date: 2017-09-12T00:56:13+03:00	[thread overview]
Message-ID: <op70ps$10lj$1@gioia.aioe.org> (raw)

I have two cursors i and j (possibly constructed from two iterators a and b) 
and need to check whether they return the same tuple of objects (objects 
with the same offset from the beginning of the iterator or the initial 
position of the cursor are the same and the number of elements the iterators 
make are the same).

Let objects for i and j are o1(i) and o2(j).

As I understand I should not use for-loop with "in iterator", because it 
supports only one iterator and I have two.

What is the best (most concise and probably most symmetric) way to express 
this algorithm with two iterators or two cursors?

Or should I first make two arrays from two iterators and then just compare 
the arrays? It may be a little inefficient, but who bothers?

-- 
Victor Porton - http://portonvictor.org


                 reply	other threads:[~2017-09-11 21:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox