Tuesday, January 30, 2024

All the control flow you'll ever need

 

(b?f:g)(x)


 Tongue in cheek, of course. Control flow corresponds to determining what (part of a) program you will run next and, of course, you can always compile down to lambda calculus in an abstract sense.

 

1 comment:

  1. I was reading https://dl.acm.org/doi/abs/10.1145/507669.507639 and from that example you have 'if b then g 13 else g 15' equals 'g (if b then 13 else 15)', what is decided by contification becomes a simple transformation.

    So, okay. You need two '(b?f:g)(x)' and 'f(b?x:y)'.

    ReplyDelete