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.

Parsing to IR and Lvalues

4 pointsby surprisetalkabout 2 months ago

1 comment

082349872349872about 2 months ago
Interpreting APL has a similar case: where a more verbose language would write something like:<p><pre><code> a+a where a=2 </code></pre> the terser APL expression is:<p><pre><code> a+a:2 </code></pre> (in which the left `a` is in scope of the right `a:`, which serves as both an lval for 2 and an rval for `a+`)<p>I don&#x27;t know how APL did&#x2F;does it, but when attempting to handle this syntax in a right-to-left operator evaluator I also wound up adding an ephemeral lvalue case.<p>(note also that C can be nearly as terse; it would express the above as:<p><pre><code> (a=2,a+a) </code></pre> assuming [unlike either of the above] that a has already been declared)