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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

How to Use Generators – batching, cancellation, pause/resume

7 点作者 bloomca超过 7 年前

1 comment

oldandtired超过 7 年前
I find it interesting that the concepts of generators being added to languages after the fact (that is not a fundamental part of the language) leads to such complex difficulties in their use.<p>Icon and UnIcon are examples where generators and co-expressions are fundamental to the language and so are used throughout most of your programs as a natural part of writing solutions to the problems being solved.<p>I find it interesting that iterators are such a big thing when they are just generators in Icon&#x2F;UnIcon. I have seen many examples written in JS where map and lambda functions are used and the equivalent in Icon&#x2F;UnIcon is a simple generator to get the same results.<p>Icon has been around since the early 80&#x27;s (as the successor of SNOBOL4) and UnIcon as a separate project since around 2000. I should remark that the UnIcon translates UnIcon programs to Icon.<p>Goes to show that there is still much life in some of these older languages.