durusmail: quixote-users: Rocinante: Quixote with generators.
Rocinante: Quixote with generators.
2003-06-06
Re: Rocinante: Quixote with generators.
2003-06-06
Rocinante: Quixote with generators.
Oscar Rambla
2003-06-06
That's my first mail to this mailing-list, so i'd like to present-me (sorry
for its extension).

My name is Oscar Rambla and i'm translating a bunch of applications, based on
C libraries, to Python language. They are structured programmed, neither
event-driven, nor threading, but rather modularized, indeed.
My first intention was to maintain their structure the most i could, trying to
avoid breaking them and include more control flow.

Quixote liked me because of its clearness ( both in theory and in practice)
but forced me (at first) to break my functions logically or phisically.
So I spent some days studying diferent techniques:
.Stackless and threading comes with more complexity and caosity in the flow.
.State machines always seemed good for machines. (I don't know how they think,
but I know that i don't want to think like that).
.Generators and pseudo-coroutines were interesting and close to my needes but
how they connect with Quixote?

Finally, I took 'the bull by the horns' .
I've extended quixote session publish to integrate generators.
The idea is to maintain a stack of generators inside the publish class. When a
component returns something that is not a string and is not callable I call
it and store it into the stack.
In fact the URL path may be seen also as the way into the stack/tree (isn't
it?)

This sems to fit well for me. It avoid me much reprogramming.
I like to call it 'Rocinante' with the permission of the creators of the
'saga'.

If anybody is interested / dedicated / have resolved something like this, i'll
be glad to hear from him.

Now , it's weekend for me.

Oscar Rambla Serra   tecnic@codidoc.com
CODI
Sant Cugat del Valles
Barcelona ( Where first Quixote book was printed.)


reply