Programming D. E. Knuth in Python with the Deterministic Finite Automaton construct

Michael Torrie torriem at gmail.com
Sat Mar 17 11:53:23 EDT 2012


On 03/17/2012 09:12 AM, Kiuhnm wrote:
> On 3/17/2012 16:01, Michael Torrie wrote:
>> On 03/17/2012 08:45 AM, Kiuhnm wrote:
>>> Your way is easy, but the result is poor.
>>
>> In what way?
> 
> The resulting code is inefficient, difficult to comprehend and to mantain.
> 
>> What is your recommended way?
> 
> One should rewrite the code. There is a reason why Python doesn't have 
> gotos.

We appear to have a language barrier here.  How should one rewrite the
code?  Everyone knows python doesn't have gotos and state machines have
to be created using other mechanisms like loops, state variables, and
such.  Your suggestion to "rewrite the code" is unhelpful to the OP if
you're not willing to suggest the best method for doing so.  Saying, "be
like a decompiler" doesn't say anything.



More information about the Python-list mailing list