<div dir="ltr">As a generalization, maybe Racket2 could keep the invariant "`#:else' is the absorbing (default) case of any multi-arm form" ?<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 5, 2013 at 4:30 PM, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">More generally, the role of `else' in `cond' is to select a particular<br>
production in the grammar of `cond' clauses, and keywords are normally<br>
the right way to do that in Racket. Keywords are normally right because<br>
they are syntactically distinct from expressions --- and so using a<br>
keyword avoids various potential ambiguities and sources of confusion.<br>
<div class="HOEnZb"><div class="h5"><br>
At Sat, 4 May 2013 10:36:14 -0500, Robby Findler wrote:<br>
> I think the bad property is the shadowing of the "else" identifier and<br>
> Matthew's point is that one way to avoid that is to not use an identifier<br>
> at all.<br>
><br>
> The racket2 wiki currently says "try this out" so I guess it isn't<br>
> something people believe will definitely be better, but something to<br>
> explore.<br>
><br>
> Robby<br>
><br>
><br>
> On Sat, May 4, 2013 at 10:33 AM, Laurent <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>> wrote:<br>
><br>
> > (that was assuming Ryan's assertion that "[...]Matthew say that he would<br>
> > have used a keyword for `else` in `cond` if he had it to do over again",<br>
> > which seem to mean that even in Racket2 Matthew would prefer `#:else' over<br>
> > `[else ...]' ?)<br>
> ><br>
> ><br>
> > On Sat, May 4, 2013 at 5:14 PM, Laurent <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>> wrote:<br>
> ><br>
> >> Matthew,<br>
> >> Out of curiosity, could you explain why you'd prefer #:else everywhere<br>
> >> instead of [else ...] ?<br>
> >> Would such an #:else allow for multi-line bodies?<br>
> >><br>
> >><br>
> >> On Sat, May 4, 2013 at 5:06 PM, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>> wrote:<br>
> >><br>
> >>> At Sat, 4 May 2013 09:15:22 -0500, Robby Findler wrote:<br>
> >>> > On Sat, May 4, 2013 at 9:07 AM, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>><br>
> >>> wrote:<br>
> >>> ><br>
> >>> > > At Fri, 3 May 2013 17:29:52 -0400, Eli Barzilay wrote:<br>
> >>> > > > A few minutes ago, Robby Findler wrote:<br>
> >>> > > > ><br>
> >>> > > > > FWIW, this was the bug in redex that prompted me to send this<br>
> >>> > > > > message (it was there for some time since it wasn't a syntax<br>
> >>> error<br>
> >>> > > > > .... it was similar in spirit to the code I posted; things broke<br>
> >>> > > > > when #f was an argument)<br>
> >>> > > ><br>
> >>> > > > [I think that it's good to have a much more relaxed policy about<br>
> >>> > > > breaking compatibility in cases like this: so far there was no real<br>
> >>> > > > code found that uses the feature, but there is one instance of code<br>
> >>> > > > that would get fixed by the change...]<br>
> >>> > ><br>
> >>> > > Well, Ian provided an example from real code, right? Ian is willing<br>
> >>> to<br>
> >>> > > change his code, but the code sounds real.<br>
> >>> > ><br>
> >>> > > There's also the use in `unparse-pattern' in Redex. Maybe that's the<br>
> >>> > > troublesome one that Robby has in mind changing (or he would be happy<br>
> >>> > > to change it, obviously), but it's another real example.<br>
> >>> > ><br>
> >>> > ><br>
> >>> > No, that was not the example. The code I sent at the beginning of the<br>
> >>> > thread was an adjusted version of the bug that hid in Redex for,<br>
> >>> roughly,<br>
> >>> > months. It was a real bug and caused real problems and we knew<br>
> >>> something<br>
> >>> > was wrong but didn't find it for some time.<br>
> >>> ><br>
> >>> > In other words, this isn't some made-up, code cleanliness-based<br>
> >>> request.<br>
> >>><br>
> >>> Yes, I understand that you faced a real bug. I hedged above on<br>
> >>> `unparse-pattern' not to suggest that your actual bug was<br>
> >>> uninteresting, but to suggest that I might misunderstand the<br>
> >>> relationship between the bug and the current state of our repository.<br>
> >>><br>
> >>> All else being equal, I'm definitely in favor of a change to a sensible<br>
> >>> `else' for `match'. The "else" that isn't equal, however, is backward<br>
> >>> compatibility, and I think we're at the right point in our development<br>
> >>> cycle to defer backward incompatibilities to the next language ---<br>
> >>> hence my vote to defer.<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></blockquote></div><br></div></div></div>