Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Variations on a Theme

Name: Anonymous 2009-11-04 1:17

Come up with variations of your favorite toy problems.  The more obfuscated the better.

I'll start with a simple one:

def factorial(n): return reduce(lambda x,y: x*y, range(1,n
+1)) if n > 1 else 1

Name: Anonymous 2009-11-07 8:36

>>28-29
It's probably Clojure, but you can implement a reader macro like that with ease in CL, just it seems like a waste of valuable macro characters. If I were to use [] for anything, it would probably be a shorthand for#'(lambda (_) ...), but I already have an Emacs key chord for inserting that...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List