What can you do in LISP that you can't do in Python

Greg Ewing see at my.signature
Thu May 24 03:30:40 CEST 2001


It occurs to me that there is one way in
which an out-of-line def'ed function is *not*
equivalent to a true inline code block:

With nested scopes as they're currently done,
there's no way to assign to a variable in an
outer non-global scope. So, for example,

  sum = 0
  def add_value(node):
    sum = sum + node.value
  for_each_node_of(my_tree, add_value)

won't work!

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list