TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Underscore Perl

3 点作者 zeeone将近 14 年前

1 comment

jerf将近 14 年前
This is... not useful. Perl doesn't have a (weak) functional-programming gap that needs fixing that badly in the first place. The big clue should have been when map had to be defined in terms of... map. Perl's map can be used directly to do the vast bulk of things in that file:<p><pre><code> # reducing; folding is obvious from here my $accum = 0; map { $accum += $_ } @nums; # filter map { $_ ? ($_) : () } @list; # also grep, of course, but if you want to filter and # do other things it's useful # flattening map { @$_ } @arrayrefs; </code></pre> For the rest, just look at the source code and observe, for instance, the pointless wrapping of List::Utils::uniq for unique. Far more idiomatic or established ways of doing all (or almost all, with the remainder being easily fixed up from CPAN) these things exist in the core shipped modules. The actual use of this library is almost certain to be both klunkier <i>and</i> less idiomatic and readable than what Perl ships with out of the box.<p>Underscore is not the <i>sine qua non</i> of weak functional programming.
评论 #2871638 未加载
评论 #2876191 未加载