Why PLT Scheme disllows one-armed ifs

In 1991 I asked Bob Hieb (Kent’s Chez Scheme buddy then, and my co-researcher on theoretical stuff) what the most frequent annoying bug was in the code. He ranked an accidentally omitted else branch among the top three. Indeed, he said that because of this, they had agreed to use WHEN and UNLESS exclusively for cases when they needed a one-armed IF and that they considered all one-armed uses as a bug or a legacy issue (which they corrected as soon as they touched a file).
We have chosen to codify their restriction. It’s a minor inconvenience that buys a good deal of clarity

(via plt)

3 thoughts on “Why PLT Scheme disllows one-armed ifs”

  1. Hunter:
    If that was a Twin Peaks reference then you added something interesting ;).

  2. For about 32 seconds I found this annoying. And then I started to admire just how beautiful my code was with all those (when …) and (unless …) blocks.
    It was absolutely clearer.
    And then I was sold.

Leave a Reply

Your email address will not be published. Required fields are marked *