[racket-dev] else clauses: possible change to match?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri May 3 11:33:07 EDT 2013

On Friday, May 3, 2013, Ryan Culpepper wrote:

> On 05/03/2013 11:12 AM, Robby Findler wrote:
>
>> Can you point to some examples?
>>
>> Note that you can still use else, as long as you don't refer to it as a
>> variable.
>>
>
> Just to check: If match treats else specially, it should only accept it as
> the entire pattern. For example, the following should be an illegal use of
> else:
>
>   (match x [(list 'if test then else) ___])
>
> Right?
>
> (BTW, I may have written exactly the code above. I need to check.)
>
>
I would not midn if that bound 'else' as a variable.

The only change I'd request is that when 'else' is the entire pattern,
since that's the situation that's confusing to people not language lawyers.

Robby



> Ryan
>
>
>  On Friday, May 3, 2013, J. Ian Johnson wrote:
>>
>>     I've used else as a catch-all binding in match. Yes, it's not the
>>     best practice, but I think since I've done it, other people must
>>     have done it too. This could annoy them.
>>     -Ian
>>     ----- Original Message -----
>>     From: "Robby Findler" <robby at eecs.northwestern.edu <javascript:;>>
>>     To: "Sam Tobin-Hochstadt" <samth at ccs.neu.edu <javascript:;>>
>>     Cc: dev at racket-lang.org <javascript:;>
>>     Sent: Friday, May 3, 2013 11:04:27 AM GMT -05:00 US/Canada Eastern
>>     Subject: Re: [racket-dev] else clauses: possible change to match?
>>
>>
>>     Given that we don't yet even have a prototype of racket2, I'm going
>>     to guess that "near" isn't all that near. IMO, there are other big
>>     things that we should be focused on going first (notably the package
>>     system).
>>
>>
>>     Just to check again: Is no one concerned with the backwards
>>     incompatibility issue?
>>
>>
>>
>>     Robby
>>
>>     On Friday, May 3, 2013, Sam Tobin-Hochstadt wrote:
>>
>>
>>     Right, I agree with this. My question is basically: are we going to,
>>     in the reasonably near future, be encouraging people to program in a
>>     `#lang racket2` where `cond` works differently, in which case it
>>     doesn't seem worth it to change `match`. Otherwise, I'll do this now.
>>
>>     Sam
>>
>>     On Fri, May 3, 2013 at 10:42 AM, Robby Findler
>>     < robby at eecs.northwestern.edu <javascript:;> > wrote:
>>      > Cond's else cannot change. I agree that that's what I would
>>     change if I
>>      > could have it back to do it over, but we cannot.
>>      >
>>      > That's the way to perhaps be thinking about racket2, tho.
>>      >
>>      > Robby
>>      >
>>      >
>>      > On Friday, May 3, 2013, Sam Tobin-Hochstadt wrote:
>>      >>
>>      >> On Fri, May 3, 2013 at 10:22 AM, Robby Findler
>>      >> < robby at eecs.northwestern.edu <javascript:;> > wrote:
>>      >> >
>>      >> > For this kind of thing, my preference would be to change match
>>     than to
>>      >> > issue
>>      >> > a warning. I don't like warnings that are basically admitting
>>     weaknesses
>>      >> > in
>>      >> > the language design.... Of course, changing a core thing like
>>     that may
>>      >> > be
>>      >> > more trouble than it is worth, due to backwards compatibility
>>     concerns,
>>      >> > which is why I think it is worth raising here to see what
>>     others think.
>>      >>
>>      >> I'm happy to make this change to `match`, except that I've heard
>>      >> Matthew say that he would have used a keyword for `else` in
>>     `cond` if
>>      >> he had it to do over again, and I wouldn't want to change one
>>     way, and
>>      >> then change back.
>>      >>
>>      >> Sam
>>
>>     _________________________
>>        Racket Developers list:
>>     http://lists.racket-lang.org/**dev <http://lists.racket-lang.org/dev>
>>
>>
>>
>> _________________________
>>    Racket Developers list:
>>    http://lists.racket-lang.org/**dev <http://lists.racket-lang.org/dev>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130503/59350736/attachment.html>

Posted on the dev mailing list.