3 ms·
My argument was that a lack of real anonymous functions (> 1 instruction) is a problem in some quite common and useful scenarios. If you REALLY can give good r
by berntb 14y ago
My argument was that a lack of real anonymous functions (> 1 instruction) is a problem in some quite common and useful scenarios.
If you REALLY can give good references that show this is wrong, I'm very interested (like, I would guess, most Ruby users).
(It would also be interesting with a link to a PEP or something with, as you claim, arguments that map etc should be discouraged -- and that is why no multi line lambdas exists. For instance, how would the syntax look like??)
- dangerlibrary 14y agoFor most use cases where you want map/filter/etc, you can chain list comprehensions using generators.
- berntb 14y agoYou have no relevant comment on what I wrote either, I take it? Here I asked for references about the GP's claims. Also, welcome to HN (or are the prepared troll accounts with a few hundreds of Karma running out? :-) ).
- pyre 14y ago| (or are the prepared troll accounts with | a few hundreds of Karma running out? :-) ) Keepin' it classy.
- berntb 14y agoConsidering the way Python people have been trolling most every Perl discussion for the last few years when I've been on HN, I feel like I'm in orbit compared to people in the mud... I might also note that I got two non sequitur answers in a row, so a joke like that is imho not an extreme reaction. Hardly as sarcastic as you was over a joke, at least... Edit: I might also note that this article (76 votes) is 5 places below another roughly equally old article (8 hours) with 13 votes. So it is probably flagged to Hell. I do feel classy, compared to some others.
- dangerlibrary 14y agoSorry, I wasn't trying to troll you. You asked about multi-line lambdas in python and I gave you a valid Python syntax for multi-line anonymous functions. Here is PEP 202, which simply says list comprehensions are more concise than for loops and map/filter etc. http://www.python.org/dev/peps/pep-0202/ http://www.python.org/dev/peps/pep-0202/ RE: accounts - I delete all of my accounts on social websites once a year.
- spacemanaki 14y agoMy argument was just that it has nothing to do with significant whitespace, which is what you were complaining about. Python could be changed to have non-significant whitespace but retain its crippled lambda.
- berntb 14y ago>>My argument was just You made specific claims (regarding map recommendations in Python and that white space has nothing to do with one instruction lambdas). I asked for references. I assume you have none? Note that with significant white space a usable syntax for multi-instruction lambdas seems... non-trivial. It seems to me as an unusually stupid fan boy position. But a few well argued references, which you lack, would change my mind. I'm no troll. Edit: I might also note that your reference nng is a low-Karma account that argues that a cometing open source language to his love child is dead -- typical language war troll. Is that your only reference?
- nnq 14y agoI should rest all this rip, but I can't help it: reference to multi-line lambdas in languages with Python-like syntax: http://cobra-language.com/trac/cobra/wiki/AnonMethod http://cobra-language.com/trac/cobra/wiki/AnonMethod, http://boo.codehaus.org/Closures http://boo.codehaus.org/Closures (yep, you're right, having multiple closures on a single line with offsite-rule syntax is "non-trivial" and no one solved this yet, but even one per line would be enough to make map and fold bearable, and ftr, I want to punch Guido or whoever else has a saying in language's design for not "stealing" this and adopting it into Python - I think there was a PEP along the lines that got killed and burried, can't find it now).
- berntb 14y ago>>I want to punch Guido or whoever else has a saying in language's design for not "stealing" this and adopting it into Python Please relax... no tool is perfect for all situations. It is always a trade off.