4 ms·
Let me give you an example from my experience. I wrote an elegant parser definition library, used for parsing specialized output of ... never mind. It had hie
by BugBrother 12y ago
Let me give you an example from my experience.
I wrote an elegant parser definition library, used for parsing specialized output of ... never mind.
It had hierarchic specifications (regular expressions etc) of parsing states, along with anonymous functions which stored away parsed data and sent the parser among different states.
New juniors could after a few hours use this to quickly parse complex text documents.
I cursed a lot while trying to port this to Python. :-( A dozen named sub-ten lines functions specified by names and referenced inside a parser structure? Just didn't work.
Edit: The point is, there are use cases where real lambdas are useful (except from map etc). It is just weird to argue otherwise.
- jsmeaton 12y agoI'm a python guy and I totally agree that multiline anonymous functions greatly enhance the readability of code in certain applications. You can do everything with named functions, but it's not always the best method for conveying meaning. I can live without multiline anonymous functions - but I'd make use of them if they did exist.