NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Ouch. Head hurt. Need beer. (Score:2)
Can you give an example of how this might make some code cleaner or more correct?
Re:Ouch. Head hurt. Need beer. (Score:1)
I have used closures + fixed point combintators several times for traversal functions when a named function just was not appropriate. I didn't know about the Y combinator at the time, but if I had, then I would have been able to clean up my code by using it to package up the closure+fixed-point combo into a single CODE ref.
But aside from that fringe usage, it is not really that useful in day to day life. In languages like Scheme and Haskell where the purity is highly valued it tends to come in handy, but thats a whole different paradigm.
Oh yeah and there is also the "street cred" factor too. I heard that at MIT there are roaving bands of Scheme hackers armed with sharpened copies of SICP [mit.edu] that prowl the hallways asking people if they know the Y combinator. I don't even want to think about what would happen to you if you didn't know it. *shudder*
- Stevan
Reply to This
Parent