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.

Brain Gymnastics: Programming Language Keyword Abuse

2 pointsby nixyover 15 years ago
To get to know a language a little better, this is a fun way to spend an hour.<p>Simply try and use all the keywords of a language of choice. Then try to reduce the code to contain each keyword as few times as possible. Also, try to remove as much as possible that isn't a keyword.<p>The code should run, and all paths should be executed.<p>This is my Javascript snippet containing all keywords only once (except "this" which occurs twice). Only one non-keyword is used -- the variable "e".<p>Have fun!<p><pre><code> try { do { var e; continue } while (void delete typeof null in undefined) } catch(e) { with(e) if ((function(){ for (;;) break; switch (true instanceof this){ case false: default: throw new this } return })()); else; } finally {}</code></pre>

2 comments

DrJokepuover 15 years ago
Branf*ck:<p><pre><code> &#60;&#62;[]+-., </code></pre> What did I win?
评论 #841515 未加载
shaunxcodeover 15 years ago
In scheme does this mean all standardly available functions or just the truly fundamental special forms?