[racket-dev] Falling through cond clauses

From: J. Ian Johnson (ianj at ccs.neu.edu)
Date: Tue Oct 2 09:56:38 EDT 2012

This experiment should be easy to run, no? Change the default cond and run DrDr?
-Ian
----- Original Message -----
From: "Carl Eastlund" <cce at ccs.neu.edu>
To: "Racket Developers" <dev at racket-lang.org>
Sent: Tuesday, October 2, 2012 9:52:38 AM GMT -05:00 US/Canada Eastern
Subject: [racket-dev] Falling through cond clauses


I often wish cond would raise an exception if all the tests failed and there were no else clause. I have taken to writing a macro to enforce this; I usually call it cond!. The void default for cond seems like an un-Racketish holdover from primarily-imperative programming. With some of the other changes we've made in Racket, are we willing to consider changing the fall-through behavior of cond? It seems like an experiment worth running to me. 

If not, I would at least like to add an erroring version of cond somewhere in the language. It's a shame to have to keep writing such a primitive feature. Right now in my dracula github repo I have cond! implemented in racket/cond and re-exported from racket, but I'm not thrilled about either the location or the name. I kept it out of racket/base so I could depend on the syntax collection for good source location reporting in the error message. 

Carl Eastlund 

_________________________
  Racket Developers list:
  http://lists.racket-lang.org/dev

Posted on the dev mailing list.