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

Lisp has changed my life

Name: Anonymous 2012-02-26 3:51

http://landoflisp.com/#yt
If you take the time to go all the way to the bottom an read the comic you'll see just what i mean by "Lisp has changed my life".

Be sure to click the throbbing text as well.

Name: Anonymous 2012-02-26 12:07

>>4
but just look at map. That shit is completely broken, and it's not just a matter of implementing a new one in couple of lines, it's fundamentally broken at language level that doesn't allow better solution.
If you're talking about needing zipWith* instead of just map, here's a way to map over an arbitrary number of lists.

Prelude> let (<**>) = zipWith ($)
Prelude> map (^2) [1..10]
[1,4,9,16,25,36,49,64,81,100]
Prelude> map (+) [1..10] <**> [11..20]
[12,14,16,18,20,22,24,26,28,30]
Prelude> map (,,) [1..5] <**> "abcde" <**> [10..15]
[(1,'a',10),(2,'b',11),(3,'c',12),(4,'d',13),(5,'e',14)]


Of course, you can't give it a list of lists to map over, but that's an intentional limitation of static typing because the length of the list might not be known at compile time. If you want that then go ahead and use a dynamic language, but stop expecting all languages to have the same design goals.

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