Hi Richard: > Message: 4 > Date: Fri, 11 Jun 2010 07:59:32 +1200 > From: Richard Tew <[email protected]> > To: Andrew Francis <[email protected]> > Cc: [email protected] > Subject: Re: [Stackless] Link to Stackless.py with select > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1
On Fri, Jun 11, 2010 at 1:21 AM, Andrew Francis <[email protected]> wrote: AF> I feel that even with ifs/hash tables, code using a select() has AF>better structure and gives more flexibility than its Go equivalent. RT>How so? Maybe I went a little over board on the better structure.... However with an if statement one can do stuff like if ch in []: blab elif ... a Go commCase is much simpler. And I believe stuff like case fallthoughs are gone. Given how case works in a Select, I don't see a great advantage over if/elif/else statements. Also, the number of cases in a select() are fixed. If we use a list we have more flexibility if ch: doStuff() channels.remove(ch) or # inside a function dispatch[newCh] = doStuff Although I think a Stackless Python select() would be used, I don't really see the need for it to be a language feature like Go. I envision myself using select() in a much more dynamic environment than maybe envisioned by Go. >Just to be clear, I mean in terms of adding custom syntax rather than >using some goto mechanism. However, I do not drink the "goto >considered harmful" kool-aid and say yes "gotos" in any case :-) Fair enough. Since Python doesn't have a goto, goto isn't on my mind often :-) However I am not clear on custom syntax. Do you mean get out PyPy and design a new language feature? Cheers, Andrew _______________________________________________ Stackless mailing list [email protected] http://www.stackless.com/mailman/listinfo/stackless
