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

Have you looked at dfns (https://en.wikipedia.org/wiki/Direct_function)? They allow you something very similar. Compare Dijkstra's GCL:

  if a < b → c := true
   □ a ≥ b → c := false
  fi
To an APL dfn with "guards":

  c ← {
        a < b : true
        a ≥ b : false
      }
As in GCL, if none of the guards hold true, the dfn (braces) will terminate without return value, and thus the code will abort with an error.



thanks! very close, except for https://en.wikipedia.org/wiki/Direct_function#:~:text=guards...

(seems like a degenerate, empty, dfn also behaves differently?)


and, modulo the above, we could spell "do X ◻ Y od" as "{X ♢ Y}⍣≡"?




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

Search: