#8739: Addition of Kolakoski word
-----------------------------+----------------------------------------------
   Reporter:  abmasse        |       Owner:  sage-combinat   
       Type:  enhancement    |      Status:  needs_info      
   Priority:  minor          |   Milestone:  sage-5.0        
  Component:  combinatorics  |    Keywords:  Kolakoski, words
     Author:                 |    Upstream:  N/A             
   Reviewer:                 |      Merged:                  
Work_issues:                 |  
-----------------------------+----------------------------------------------
Changes (by ncohen):

  * status:  needs_review => needs_info


Comment:

 Looks nice ! :-)

 Several remarks though, that I do not dare implement myself :

 * You specify in the private function `_KolakoskiWord_iterator` that the
 alphabet must be composed of two positive integers, but not in
 `KolakoskiWord`. Are the users supposed to know they should not use
 anything else ? (honest question, Words are not my field at all even if I
 can understand the construction :-) )

 * You write `current_letter = bar(w[-1])`, thus accessing the -1'th
 element. What about writing `current_letter = bar(current_letter)` at the
 end of the loop ?

 * You maintain a variable named `current_run`, and keep in memory a list
 of letters you already used (`w[:current_run]`). Wouldn't it be easier to
 forget about the current run variable, and just use your list as a queue
 with append() and pop(0) operations ? :-)

 As I did not know the construction, I thought a bit about how I would
 write the algorithm and could not find any way to do it without keeping a
 lot of things in memory, what your `w` variable actually contains. Do you
 know if there exists a way to get rid of it ? I'm just being curious :-)

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8739#comment:3>
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.

Reply via email to