[r6rs-discuss] [Formal] Remove the (r6rs when-unless) library

From: Aubrey Jaffer <agj>
Date: Mon Mar 12 12:57:58 2007

 | From: "R. Kent Dybvig" <dyb_at_cs.indiana.edu>
 | Date: Sun, 11 Mar 2007 22:38:18 -0400
 |
 | I'm responding as a user/implementor, not speaking for the editors.
 |
 | > This is mainly an attempt to stimulate discussion: Given that
 | > `when' and `unless' offer little advantage over just using `if',
 | > and given that their definitions are so trivial, it's unclear
 | > whether the benefit of having a separate library with these in
 | > the standard is worth the cost. As I don't use `when' and
 | > `unless', it's clear that they're not worth the cost to me. I
 | > wonder what others think.
 |
 | The first "given" is debatable---I believe that when and unless
 | make the programmers intent immediately clear while one-armed if
 | can be mistaken on first glance for a two-armed if. when and
 | unless also both include an implicit begin, which is sometimes
 | convenient.

COND also has implicit BEGINs; and COND can be extended to
alternatives by adding clauses.

"(when condition . stmts)" is a savings of 2 characters over
"(cond (condition . stmts))".

"(unless condition . stmts)" is a savings of 6 characters over
"(cond ((not condition) . stmts))".

 | I agree that a separate library is a bit silly. I wouldn't mind if
 | they were in the base library.

They save little typing and add no expressiveness to the language over
COND. I would prefer they have no standing in R6RS.

 | I wonder how many people would support eliminating one-armed if
 | from the language.

Appendix A: "Sample Definitions for Derived Forms" uses one-armed IF
in two places. Eliminating one-armed IF would require artifice for
cases like:

  (COND (#f)) ==> #<unspecified>
Received on Sun Mar 11 2007 - 23:17:47 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC