News for hackers. Stuff that matters.
Re:Show HN: Cosh – concatenative command-line shell by saeranv on Tuesday January 17, 2023 @10:48PM (#34423249)
I'm really intrigued by this, because I like postfix notation and would love to be able to work more with in. Unfortunately, I only somewhat understand the examples!

Question: Does the postfix notation allow you to chain commands together that in bash would have to be nested in brackets, like actual postfix math?

So for example, rather than the infix need of brackets to resolve ambiguity in this expression ((1 + 2) * 3) = 9, postfix just writes it like this: 1 2 + 3 * = 9.

Re:Show HN: Cosh – concatenative command-line shell by tomhrr on Wednesday January 18, 2023 @01:13AM (#34423912)
Thanks, and yep, the postfix notation allows for chaining commands together without parentheses. For example:

  1 2 +; 3 *
(The semicolon is used to indicate that the previous string (token) is a function and should be executed. In some instances this is implicit, like when the last string (token) in a larger command (like the one above) maps to a function name, in which case it will be treated as a function call even when no semicolon appears after it.)