Let's not piggy-back too much on this one change. First of all, I'm proposing a very simple change, albeit with potentially complex consequences; you've got a somewhat more complex design change in mind, but entirely backwards compatible. Second, you detect definitions by using "define" as a keyword? No, thank you, sir. Let me know when you have a design that allows arbitrary definitions. Personally I think this concept will work better as a new macro than an add-on for cond, because you're turning the already-overloaded test position, which can be an expression or a cond-specific keyword, into a triple-overload including definition special form names.<br>
<br clear="all">Carl Eastlund<br>
<br><div class="gmail_quote">On Tue, Oct 2, 2012 at 10:11 AM, Jay McCarthy <span dir="ltr"><<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In addition to this, I want internal definitions in conds:<br>
<br>
(cond<br>
[test1 body1]<br>
(define var ...)<br>
[(test2 var) body2]<br>
[(test3 var) body3])<br>
<br>
I have a macro that does these things:<br>
<br>
<a href="https://github.com/jeapostrophe/exp/blob/master/condd.rkt" target="_blank">https://github.com/jeapostrophe/exp/blob/master/condd.rkt</a><br>
<br>
It's pretty cute<br>
<br>
Jay<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Oct 2, 2012 at 7:58 AM, Carl Eastlund <<a href="mailto:cce@ccs.neu.edu">cce@ccs.neu.edu</a>> wrote:<br>
> Oh, no, as far as a "does it work out of the box" experiment goes, it fails.<br>
> Racket doesn't even compile. I meant more along the lines of our<br>
> immutable-cons experiment, where we fix a bunch of code and see how<br>
> problematic the compatibility issue becomes over time.<br>
><br>
> Carl Eastlund<br>
><br>
><br>
> On Tue, Oct 2, 2012 at 9:56 AM, J. Ian Johnson <<a href="mailto:ianj@ccs.neu.edu">ianj@ccs.neu.edu</a>> wrote:<br>
>><br>
>> This experiment should be easy to run, no? Change the default cond and run<br>
>> DrDr?<br>
>> -Ian<br>
>> ----- Original Message -----<br>
>> From: "Carl Eastlund" <<a href="mailto:cce@ccs.neu.edu">cce@ccs.neu.edu</a>><br>
>> To: "Racket Developers" <<a href="mailto:dev@racket-lang.org">dev@racket-lang.org</a>><br>
>> Sent: Tuesday, October 2, 2012 9:52:38 AM GMT -05:00 US/Canada Eastern<br>
>> Subject: [racket-dev] Falling through cond clauses<br>
>><br>
>><br>
>> I often wish cond would raise an exception if all the tests failed and<br>
>> there were no else clause. I have taken to writing a macro to enforce this;<br>
>> I usually call it cond!. The void default for cond seems like an<br>
>> un-Racketish holdover from primarily-imperative programming. With some of<br>
>> the other changes we've made in Racket, are we willing to consider changing<br>
>> the fall-through behavior of cond? It seems like an experiment worth running<br>
>> to me.<br>
>><br>
>> If not, I would at least like to add an erroring version of cond somewhere<br>
>> in the language. It's a shame to have to keep writing such a primitive<br>
>> feature. Right now in my dracula github repo I have cond! implemented in<br>
>> racket/cond and re-exported from racket, but I'm not thrilled about either<br>
>> the location or the name. I kept it out of racket/base so I could depend on<br>
>> the syntax collection for good source location reporting in the error<br>
>> message.<br>
>><br>
>> Carl Eastlund<br>
>><br>
>> _________________________<br>
>> Racket Developers list:<br>
>> <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
>><br>
><br>
><br>
> _________________________<br>
> Racket Developers list:<br>
> <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br>
<a href="http://faculty.cs.byu.edu/%7Ejay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>
"The glory of God is Intelligence" - D&C 93<br>
<br>
</font></span></blockquote></div><br>