Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Parsing to IR and Lvalues (bernsteinbear.com)
4 points by surprisetalk 11 months ago | hide | past | favorite | 1 comment


Interpreting APL has a similar case: where a more verbose language would write something like:

    a+a where a=2
the terser APL expression is:

    a+a:2
(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+`)

I don't know how APL did/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.

(note also that C can be nearly as terse; it would express the above as:

  (a=2,a+a)
assuming [unlike either of the above] that a has already been declared)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: