Oh I should have rather exchanged u and i above. That is (informally)
[s.idx for idx in u | idx in expand(i)]
because that would correctly give the order in which the elements are
returned even in the case of c<0 or if u = ((a..) by c).
Informal meaning of 'elt' should be clear. The problem is in
fine details and corner cases and those IMO boil down to
fact that streams are lazy and list are eager.
Hmmm... I just see that in OneDimensionalArrayAggregate there is
elt(a : %, s : UniversalSegment(Integer)) ==
l := low(s)
h := if hasHi s then high(s) else maxIndex a
l < minIndex a or h > maxIndex a => error "index out of range"
r := stupidnew(max(0, h - l + 1)::NonNegativeInteger, a, a)
for k in minIndex r.. for i in l..h repeat
qsetelt!(r, k, qelt(a, i))
r
Maybe I should change that, as well to agree with the informal meaning
of "intersecting the index sets", i.e. we should rather yield empty()
instead of "index out of range". Do you agree?
If elt is done, maybe "delete" should get a similar meaning, i.e.
removing the respective indices and ignore "out of range" errors.
Similar for setelt!.
Ralf
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/9236e41d-3418-0d0a-727c-0bc15ff0a05f%40hemmecke.de.