News for hackers. Stuff that matters.
Re:Not Lisp again.... by elai on Thursday March 05, 2009 @07:37PM (#504993)
Hey you can do this w/ python too!

<code> dx = .000001

def deriv(f): def fprime(x): return (f(x+dx) - f(x))/dx return fprime

def cube(x): return x3

def printDeriv(x): print (deriv(cube))(x) print 3x*2

printDeriv(5) </code>

Re:Not Lisp again.... by sketerpot on Thursday March 05, 2009 @09:25PM (#505072)
In general, you can do this in any language which lets you pass functions around as values, and which supports closures. And languages in which you can fake it somehow.
Re:Not Lisp again.... by gaius on Friday March 06, 2009 @05:23AM (#505352)
Start a line with 4 spaces, rather than using <code> tags.