Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: What technical benfits perl offers over python + few more questions. (first class functions)by LanX (Saint) |
on Nov 13, 2021 at 15:46 UTC ( [id://11138782]=note: print w/replies, xml ) | Need Help?? |
> 2. I'm not sure I understand how a function can be thought of as a second-class citizen; because that's FUD "First class object" aka citizen basically means you can pass functions around as arguments to other functions. E.G. most BASIC dialects I've seen couldn't do that. It's a necessity for functional programming... Perl is actually better in functional programming, since Python is restricting lambdas to one expressions only, while anonymous subs are free. And Python doesn't offer any block prototype to make it even easier like sub foo (&) { $code = shift; ... } Superficial people will claim that the need to explicitly reference named subs in Perl with ... \&foo means they are not first class. Superficially so because almost everything in Python is implicitly a reference. Now, who said explicit is better than implicit again ...???
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|