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

2013-05-06 Thread Jay McCarthy
On Mon, May 6, 2013 at 7:29 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Mon, 6 May 2013 07:02:47 -0600, Jay McCarthy wrote: On Mon, May 6, 2013 at 6:52 AM, Matthew Flatt mfl...@cs.utah.edu wrote: 3. And a side-comment: I hope that there will be something better than actual `racket2'

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

2013-05-06 Thread Robby Findler
On Monday, May 6, 2013, Jay McCarthy wrote: On Mon, May 6, 2013 at 7:29 AM, Matthew Flatt mfl...@cs.utah.edujavascript:; wrote: At Mon, 6 May 2013 07:02:47 -0600, Jay McCarthy wrote: On Mon, May 6, 2013 at 6:52 AM, Matthew Flatt mfl...@cs.utah.edujavascript:; wrote: 3. And a

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

2013-05-05 Thread Matthew Flatt
More generally, the role of `else' in `cond' is to select a particular production in the grammar of `cond' clauses, and keywords are normally the right way to do that in Racket. Keywords are normally right because they are syntactically distinct from expressions --- and so using a keyword avoids

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

2013-05-05 Thread Laurent
As a generalization, maybe Racket2 could keep the invariant `#:else' is the absorbing (default) case of any multi-arm form ? On Sun, May 5, 2013 at 4:30 PM, Matthew Flatt mfl...@cs.utah.edu wrote: More generally, the role of `else' in `cond' is to select a particular production in the grammar

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

2013-05-05 Thread Eric Dobson
Keywords are normally right because they are syntactically distinct from expressions --- and so using a keyword avoids various potential ambiguities and sources of confusion. Isn't this only true for default bindings of #%datum? It seems like macros which assume this lose compatibility with

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

2013-05-05 Thread Ryan Culpepper
On 05/05/2013 12:49 PM, Eric Dobson wrote: Keywords are normally right because they are syntactically distinct from expressions --- and so using a keyword avoids various potential ambiguities and sources of confusion. Isn't this only true for default bindings of #%datum? It seems like macros

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

2013-05-04 Thread Matthew Flatt
At Fri, 3 May 2013 17:29:52 -0400, Eli Barzilay wrote: A few minutes ago, Robby Findler wrote: FWIW, this was the bug in redex that prompted me to send this message (it was there for some time since it wasn't a syntax error it was similar in spirit to the code I posted; things broke

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

2013-05-04 Thread Robby Findler
On Sat, May 4, 2013 at 9:07 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Fri, 3 May 2013 17:29:52 -0400, Eli Barzilay wrote: A few minutes ago, Robby Findler wrote: FWIW, this was the bug in redex that prompted me to send this message (it was there for some time since it wasn't a

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

2013-05-04 Thread Matthew Flatt
At Sat, 4 May 2013 09:15:22 -0500, Robby Findler wrote: On Sat, May 4, 2013 at 9:07 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Fri, 3 May 2013 17:29:52 -0400, Eli Barzilay wrote: A few minutes ago, Robby Findler wrote: FWIW, this was the bug in redex that prompted me to send

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

2013-05-04 Thread Laurent
Matthew, Out of curiosity, could you explain why you'd prefer #:else everywhere instead of [else ...] ? Would such an #:else allow for multi-line bodies? On Sat, May 4, 2013 at 5:06 PM, Matthew Flatt mfl...@cs.utah.edu wrote: At Sat, 4 May 2013 09:15:22 -0500, Robby Findler wrote: On Sat,

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

2013-05-04 Thread Robby Findler
Okay, makes sense. Lets leave it alone. Robby On Sat, May 4, 2013 at 10:06 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Sat, 4 May 2013 09:15:22 -0500, Robby Findler wrote: On Sat, May 4, 2013 at 9:07 AM, Matthew Flatt mfl...@cs.utah.edu wrote: At Fri, 3 May 2013 17:29:52 -0400, Eli

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

2013-05-04 Thread Laurent
(that was assuming Ryan's assertion that [...]Matthew say that he would have used a keyword for `else` in `cond` if he had it to do over again, which seem to mean that even in Racket2 Matthew would prefer `#:else' over `[else ...]' ?) On Sat, May 4, 2013 at 5:14 PM, Laurent

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

2013-05-04 Thread Robby Findler
I think the bad property is the shadowing of the else identifier and Matthew's point is that one way to avoid that is to not use an identifier at all. The racket2 wiki currently says try this out so I guess it isn't something people believe will definitely be better, but something to explore.

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

2013-05-04 Thread Asumu Takikawa
On 2013-05-04 10:36:14 -0500, Robby Findler wrote: The racket2 wiki currently says try this out so I guess it isn't something people believe will definitely be better, but something to explore. FWIW, Clojure uses keywords for `else` so there is some experience there:

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

2013-05-04 Thread Greg Hendershott
There will be people who see the long BNF for match in the Reference, and flee to the Guide to try to learn by example instead. Even when they later do read the Reference carefully, they'll be left with first impressions of idioms from the Guide. (I might be one of those people. Cough.) The

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

2013-05-04 Thread Robby Findler
Oh, right! Thanks! I'll push something that explicitly mentions underscore and adjust the elses to use underscores. Robby On Sat, May 4, 2013 at 9:09 PM, Greg Hendershott greghendersh...@gmail.comwrote: There will be people who see the long BNF for match in the Reference, and flee to the

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

2013-05-03 Thread Laurent
That one is twisted indeed, if you forget about how `else' must be written in `match' (which I had, not using match too much). I was thinking about issuing a warning when a syntax-parameter gets shadowed (if that is even catchable). Then suddenly I realized Racket doesn't do warnings. (Is there a

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

2013-05-03 Thread Robby Findler
We do have warnings for things like the optimizer detecting a bad application of a function, for example, but they go into the logger and you have to say the magic words (open sesame?) to get them out. For this kind of thing, my preference would be to change match than to issue a warning. I don't

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

2013-05-03 Thread Laurent
On Fri, May 3, 2013 at 4:22 PM, Robby Findler ro...@eecs.northwestern.eduwrote: I don't like warnings that are basically admitting weaknesses in the language design Ah, that's the answer my subconscious was seeking when I wondered about Racket warnings. Good point! FWIW, I'd vote (with

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

2013-05-03 Thread Sam Tobin-Hochstadt
On Fri, May 3, 2013 at 10:22 AM, Robby Findler ro...@eecs.northwestern.edu 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

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

2013-05-03 Thread Robby Findler
That's my take too, but we should really be careful about changes at this level. Robby On Friday, May 3, 2013, Laurent wrote: On Fri, May 3, 2013 at 4:22 PM, Robby Findler ro...@eecs.northwestern.edujavascript:_e({}, 'cvml', 'ro...@eecs.northwestern.edu'); wrote: I don't like warnings

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

2013-05-03 Thread Robby Findler
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

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

2013-05-03 Thread Sam Tobin-Hochstadt
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,

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

2013-05-03 Thread Robby Findler
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?

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

2013-05-03 Thread J. Ian Johnson
Cc: dev@racket-lang.org 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

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

2013-05-03 Thread Robby Findler
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

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

2013-05-03 Thread Eli Barzilay
A few minutes ago, Robby Findler wrote: 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). +1, since the damage would be that people

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

2013-05-03 Thread J. Ian Johnson
it too. This could annoy them. -Ian - Original Message - From: Robby Findler ro...@eecs.northwestern.edu To: Sam Tobin-Hochstadt sa...@ccs.neu.edu Cc: dev@racket-lang.org Sent: Friday, May 3, 2013 11:04:27 AM GMT -05:00 US/Canada Eastern Subject: Re: [racket-dev] else clauses

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

2013-05-03 Thread Ryan Culpepper
:; 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

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

2013-05-03 Thread Neil Toronto
On 05/03/2013 09:12 AM, Eli Barzilay wrote: A few minutes ago, Robby Findler wrote: 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).

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

2013-05-03 Thread Eli Barzilay
A few minutes ago, Robby Findler wrote: FWIW, this was the bug in redex that prompted me to send this message (it was there for some time since it wasn't a syntax error it was similar in spirit to the code I posted; things broke when #f was an argument) [I think that it's good to have