Hacker News new | past | comments | ask | show | jobs | submit login

The next logical step is to mark with parentheses the two branches of the if expression:

  (if (or cond1 cond2) (then) (else))
although i suppose it's not really hugo anymore..



Going along with the joke, that's almost how elisp (most of the other lisps too, I believe) works:

    (if (or cond1 .. condn)
        (progn
          (true1)
          (true2))
      (false1)
      (false2))
But in Go templates, it would be:

{{ if (or cond1 .. condn) }} true1 true2 {{ else }} false1 false2 {{ endif }}


Is there a reason something more standard like "if cond1 or cond2 then x else y" isn't supported? Parsing speed?


Maybe. It looks like Reverse Polish Notation.


It's regular Polish notation.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: