yield equivalent in C/JavaScript?

Paul Rubin phr-n2002b at NOSPAMnightsong.com
Sun Jun 30 02:51:42 EDT 2002


Robin Becker <robin at jessikat.fsnet.co.uk> writes:
> the generators here are things  associated with compression or
> decompression methods. The complexity is such that a severe
> reformulation will be tough. I understand the concept, but I think it's
> easier to just try and consume the whole input at one go and pass it on.

If you are trying to implement data compression in javascript with
large enough inputs that memory consumption is a problem, you probably
have worse problems than absence of "yield".  Javascript is so slow
your program will probably be near unuseable.  What's the JS
environment and the application?  If it's client side JS in a web
browser, you're probably using the wrong approach to the problem.  If
it's something like Netscape server side JS, use the LiveConnect stuff
to implement the compression in C.




More information about the Python-list mailing list