#8604: Add a class for factor-enumerable words
-----------------------------+----------------------------------------------
Reporter: slabbe | Owner: slabbe
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.4
Component: combinatorics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Changes (by abmasse):
* status: needs_review => needs_work
Comment:
Replying to [comment:4 slabbe]:
> > Very interesting ! I'll try to review this patch as soon as I have
some time.
>
> Great!
>
> > I took a quick look at it and I have a question, though. Why aren't
the
> > iterator functions (on the left special, bispecial and right special
factor)
> > public ?
>
> I would not say that they are not public since anybody can use it and
access it with tab completion by adding the underscore first.
>
> Well because many of the iterator functions are already hidden this way
in sage words. We might want to change this convention. Or maybe, like
`factor_iterator`, you think it would be more practicable if those were
not hidden as well?
>
I understand your point, but I still think that since the class of factor-
enumerable words was introduced in particular to deal with infinite words,
one will probably need iterators to handle, say, left special factors. For
instance, assume I want to enumerate all right special factors of a given
Sturmian word. I'll need to use an iterator (the list won't be built since
it's infinite). And I would like the function to appear when I hit `TAB`
when calling a function on an infinite word.
What I suggest is to remove the underscore character in front of the
iterators and even add a warning for the functions
`right_special_factors`, etc. that tells the user that this function could
not stop.
> > Since they are used only in the public functions that return the
> > result as a list, I think it would be better either to make the
iterator
> > functions public, or to merge the two functions in one. Unless you've
a
> > reason to do so ?
>
> I am against merging those two functions in one since both functions can
be very usefull in different situations. The only question I see is (I
don't like using the word public) :
>
I agree with you on this one, that was a bad idea.
> Do we want the iterator functions of this patch to appear in the default
listing of the tab completion on a word?
>
I say yes! I know one of your argument about that was that it would reduce
the number of functions appearing when you hit `TAB`. On the other hand,
there are not so many of them in the case of infinite words.
> Sébastien
>
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8604#comment:6>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.