[sapug] Excellent presentation on generators

Daryl Tester dt-sapug at handcraftedcomputers.com.au
Mon Mar 24 21:50:34 CET 2008

Chris Foote wrote:

> I haven't looked at Common LISP streams yet...  The language is so big
> that you can study it for ages and not scratch the surface :-)

Luckily, they crop up in Scheme, so it doesn't take as long to
reach 'em.  :-)

> I've been playing with Lua lately, and its co-routines make my brain
> hurt :-)  The end of the PyCon presentation gets into co-routines,
> which I think might be in Python 3000.  I haven't made up my mind
> whether they're good or not.

Ah, well that will dredge up some submerged memories for me - the
last time I played seriously with co-routines was when I implemented
them.  Under CP/M.  (which might date when that happened somewhat :-)

>> Decorators still don't come naturally to me - have to stare at them
>> for a while before the light clicks (instead of just going 'Aha!'
>> and moving on).

> I've only used them for @staticmethod in the past.  I need to find some
> good examples of what you can do with them before I know how they're
> really useful.

Likewise with staticmethod (and because of that that's the first
thing that leaps to mind when I see an @ in Python ...).  I saw
some examples the other month for unit testing, where they were
used for patching the module under test for mocking purposes (i.e.
stubbing out database lookups, etc.) in a pre/post manner.  Again
it didn't look intuitively obvious to me.  :-/

I guess my brain is less rubbery than it used to be.

  Daryl Tester

"We are sexy, sexy Von Neumann machines."  -- http://www.xkcd.org/387/

More information about the sapug mailing list