If Scheme is so good why MIT drops it?

greg greg at cosc.canterbury.ac.nz
Thu Jul 30 03:09:14 CEST 2009


Hendrik van Rooyen wrote:

> And if code is data, where is Pythons ALTER statement?

class Duck:

   def quack(self):
     print "Quack!"

def moo():
   print "Moo!"

def ALTER(obj, name, TO_PROCEED_TO):
   setattr(obj, name, TO_PROCEED_TO)

d = Duck()
ALTER(d, 'quack', TO_PROCEED_TO = moo)
d.quack()

-- 
Greg



More information about the Python-list mailing list