TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using and Abusing Macros

4 pointsby dradtkeabout 11 years ago

1 comment

gus_massaabout 11 years ago
I use macros in Racket, and generally the idea is that they mix with the language until its not clear which are the language constructions and which are the user defined macros.<p>For example, instead of<p><pre><code> pub static SMITHY: Card = action! { &quot;Smithy&quot; costs 3 and calls do_smithy }; </code></pre> I’d written it as<p><pre><code> pub static SMITHY: Card = action! { &quot;Smithy&quot;, 3, do_smithy }; </code></pre> Is this possible in Rust, or comas are special?
评论 #7460799 未加载
评论 #7460572 未加载