[bitc-dev] CLEANUP: Two-legged "if"

Jonathan S. Shapiro shap at eros-os.com
Thu Jul 17 07:54:12 CDT 2008


If anybody has strong objections, we need to hear them!



As we have been writing code, I find increasingly that I want to be able
to use a two-legged if. In functional programs this form has fairly
limited value, but in stateful programs it is a very common idiom.

Because of this, I find myself writing:

  (if e-test (begin e-then ())
             ())

a whole lot, purely to work around the fact that an IF form is required
to have two legs.

I finally got tired of this, and I have now added

  (if e-test e-then)

to the spec as a derived form returning unit:

  (if e-test e-then)  =>
  (if e-test (begin e-then ()) ())

shap



More information about the bitc-dev mailing list