Announcing bytecodehacks 0.10

Michael Hudson mwh21 at cam.ac.uk
Wed May 12 19:27:38 EDT 1999


Michael Vanier <mvanier at bbb.caltech.edu> writes:
> Michael Hudson <mwh21 at cam.ac.uk> writes:
> 
> > If you've been following the "Python is too slow" thread of late, you
> > might have noticed my sneaky bytecode rewriting functions.
> > 
> > Well, they've been rewritten, added to and generally banged on, and
> > remarkably enough, there's nearly full documentation (Thanks to Fred
> > Drake and all the others for making making documentation so easy).
> > 
> > The package (and that's how it's distributed) splits into two parts -
> > the byte code editing routines and the "bytecodehacks" that are
> > usuable without a degree in python arcanery, although one might help
> > understand some of the consequences.
> 
> Cool stuff, Michael!  Keep up the good work :-)

This seems inevitable (me keeping on working at these). I haven't
found a way of stopping myself yet. There are new source and
documentation tarballs, the online docs have been updated. Nothing
much has changed but Fred Drake explained how the documentation system
actually works...
 
> > bytecodehacks.xapply - a sort-of lazy apply
> > 
> > from bytecodehacks.xapply import xapply
> > 
> > def add(x,y):
> >     return x+y
> > add1=xapply(add,1)
> > add1(1) => 2
> 
> Maybe "curry" would have been a better name.


Well this module is inspired by Don Beaudry's functor module which
calls this function `xapply'. 

I see your point though.

> 
> > bytecodehacks.setq - this one should interest people!
> > 
> > You want assignment expressions? Have them!
> > 
> > def f(x):
> >     while setq(x,x-1):
> >         print x
> > from bytecodehacks import setq
> > g=setq.setqize(f)   
> > g(4)
> > 3
> > 2
> > 1
> > 
> 
> Now we can put that thread to rest for good :-)

I wish.
 
> We'll-make-python-into-scheme-yet-even-if-we-have-to-drag-it-
> kicking-and-screaming-all-the-way-ly y'rs,

oh-my-wouldn't-macros-be-nice-ly y'rs

Michae;




More information about the Python-list mailing list