Functional Programming Madness
Source : Lion Kimbro's Blog
I’ve been reading Text Processing in Python, and been digging deep into it. Just because I love text processing, and the like. And this book, it really should’ve been called: “Functional Programming in Python.” (He does write on that a lot, incidentally.) Now, what I did, was: I spent about, oh, let’s see… Perhaps 3 days, just studying Section 1, of Chapter 1. When I learn something, I really like to learn it. And boy, have I learned something. I’ve been tearing apart my old text processing scripts, reducing them to 10% prior length. I’ve been amazed at what I’ve been seeing. But my reason for posting this, isn’t to tell you what I’ve learned. (In a sentence: It’s neat to abstract flow control, and be very specific.) I’m actually here to ask my readers something. My readers who know about functional programming. My question follows:
Where do I find a standard list of higher order functions? A lot of these problems, I’m like: “Whoever reads this, is going to go insane, learning all my custom functions.” For example: I have a grouping function. It groups sequential items in a list that match a test, does something with them, and puts the result in place in the output list. map gives you one function vs. many items, Mertz calls something that gives many functions over a single item “apply_each” — is this normal? I made a function that sort of “rotates” an argument into a function itself. You apply the function you intended to this “functionized” argument, and it gives you the result. I’m sure someone has thought of this before, and I’m sure it’s got a name somewhere [..]
Lion
le 12.06.06 à 23:12
dans Mind
-
Article précédent - Commenter - Article suivant -