#15820: Implement sequences of bounded integers
--------------------------------------------+------------------------
       Reporter:  SimonKing                 |        Owner:
           Type:  enhancement               |       Status:  new
       Priority:  major                     |    Milestone:  sage-6.2
      Component:  algebra                   |   Resolution:
       Keywords:  sequence bounded integer  |    Merged in:
        Authors:                            |    Reviewers:
Report Upstream:  N/A                       |  Work issues:
         Branch:                            |       Commit:
   Dependencies:                            |     Stopgaps:
--------------------------------------------+------------------------

Comment (by SimonKing):

 Replying to [comment:23 ncohen]:
 > > Why? It should be a replacement for tuples (thus, low-level), but it
 should ''ideally'' be (close to) a drop-in replacement (thus, it doesn't
 matter whether one uses it by mistake).
 >
 > Why do you want it to inherit from tuple ?

 By analogy to `Sequence_generic` (which inherits from `list`):
 {{{
 sage: S = Sequence([1,2,3])
 sage: type(S)
 <class 'sage.structure.sequence.Sequence_generic'>
 sage: type(S).mro()
 [sage.structure.sequence.Sequence_generic,
  sage.structure.sage_object.SageObject,
  list,
  object]
 }}}

 > Well, somehow that's already what we do with graph backends. We have a
 Generic Backend, extended twice in  Dense Graphs and Sparse Graphs. And
 all the constants needed by the data structures are stored in the
 corresponding files.

 No, that's a different situation. If you have a sequence `S1` of integers
 bounded by `B1` and a sequence `S2` of integers bounded by `B2` then the
 constants for `S1` are different from the constants of `S2`. So, it is not
 really a "global" constant that is shared by all instances of a certain
 data structure (and could thus be put into a file), but when you do, for
 example, `for x in B1` then you'll need ''different'' constants than when
 you do `for x in B2`.

 So, these constants are not shared by all sequences, but by all sequence
 that share the same bound. Thus, it seems natural (to me, at least) to
 have one object `O(B)` that is shared by all sequences of bound `B`, so
 that `O(B)` provides the constants that belong to `B`.

 Sure, `O(B)` could be written in C as well. But why not making it a
 parent, when all what we do is letting each sequence have a pointer to
 `O(B)`?

--
Ticket URL: <http://trac.sagemath.org/ticket/15820#comment:24>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to