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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A Codewalk for Arc3's first-class(runtime) macros

18 点作者 wsxiaoys将近 13 年前

2 条评论

dpkendal将近 13 年前
Actually macros are not first-class in Arc (though they are stored in the same namespace as everything else, unlike in Scheme). You can't return one from a function, for instance. They were a feature of early implementations (they're mentioned in various places in old stuff related to its development), but they were cut before the first release. When I asked pg why he removed them, his answer was:<p>&#62; I don't remember. It was either because they were useless or confusing or intellectually inelegant.<p>Having experienced first-class macros in my own Lisp implementation, I'm inclined to agree. Though there are various promises of efficient implementations scattered through the internet, nobody actually goes into enough detail to explain it. Non-first-class macros are the way to go for efficiency, at least, and first-class macros themselves are fairly useless.
评论 #4036200 未加载
评论 #4036117 未加载
leppie将近 13 年前
There is something very wrong with the concept of 'runtime' macros. How is a 'runtime' macro any better than a function/procedure? TBH, I have no idea what a use case would be for a 'runtime' macro. A macro is generally a compile-time source transformation. If you need that at runtime, use EVAL.
评论 #4036562 未加载
评论 #4040467 未加载