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.

2D Racket Syntax

88 pointsby veqq5 months ago

4 comments

kazinator5 months ago
I love how this is upvoted to 33 and no comments. It&#x27;s okay to just shut up and admire sometimes.<p>Good for you for getting that, HackerNews. Except for me.<p>Why isn&#x27;t the example like this, to show that the notation nests? Or else state clearly that it does not:<p><pre><code> (define (same? a b) #2dcond ╔═════════════╦══════════════════════════════════════════════════════╦═════════════╗ ║ ║ (pair? a) ║ (number? a) ║ ╠═════════════╬══════════════════════════════════════════════════════╬═════════════╣ ║ ║ #2dcond ║ ║ ║ ║ ╔════════════════════════╦════════════════════════╗ ║ ║ ║ (pair? b) ║ ║ ║ (same (car a) (car b)) ║ ║ #f ║ ║ ║ ╠════════════════════════╬════════════════════════╣ ║ ║ ║ ║ ║ (same (cdr a) (cdr b)) ║ #t ║ ║ ║ ║ ║ ╚════════════════════════╩════════════════════════╝ ║ ║ ╠═════════════╬══════════════════════════════════════════════════════╬═════════════╣ ║ (number? b) ║ #f ║ (= a b) ║ ╚═════════════╩══════════════════════════════════════════════════════╩═════════════╝) </code></pre> Also, the empty cell in the upper left of #2dcond could be used for specifying the default value, overriding the #f default default.
评论 #42376203 未加载
kitd5 months ago
2D languages are an under-researched area of SW dev, IMHO, But I applaud this effort.<p>On the one hand, they can significantly reduce the cognitive effort expressing and understanding code with complex relationships, OTOH they&#x27;re a bit of a nightmare to actually use, especially the ones that use some form of ASCII art.<p>I wrote a parser for a simple petri net flow diagram that used ASCII art that constructed the state machine between function calls. It worked well until I actually tried to do anything serious with it. The effort required to keep the chart looking tidy quickly outweighs the effort writing a normal pure-code form.<p>IMO, a more &quot;Pythonic&quot;, indentation-based diagram may be better but I think you&#x27;re restricted then in the types of problems you can express.<p>As I say, this all needs more research.
评论 #42376073 未加载
评论 #42376526 未加载
评论 #42376052 未加载
评论 #42375901 未加载
rvense5 months ago
Racket and Scheme are full of these things that appear a little unhinged but then you realize that it&#x27;s all built from a few very simple principles.
评论 #42376640 未加载
0823498723498725 months ago
obligatory mention of &quot;analogue literals&quot;: <a href="http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20110714020203&#x2F;http:&#x2F;&#x2F;weegen.home.xs4all.nl:80&#x2F;eelis&#x2F;analogliterals.xhtml" rel="nofollow">http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20110714020203&#x2F;http:&#x2F;&#x2F;weegen.home...</a>