Re: [racket] confusing error with keywords

2010-11-17 Thread Matthias Felleisen
Syntax errors are a problem because there is no fixed syntax. (And I am sorry I don't have the energy to explain this problem the umpteeth time.) On Nov 17, 2010, at 5:23 PM, Ryan Culpepper wrote: > Syntax has dependencies. In (X . ARGS), the interpretation of ARGS depends on > X. So X sho

Re: [racket] confusing error with keywords

2010-11-17 Thread Ryan Culpepper
Syntax has dependencies. In (X . ARGS), the interpretation of ARGS depends on X. So X should be validated* before ARGS is interpreted. Most macros either obey this principle automatically or have relatively benign violations**, but #%app is a bit special. I agree with Carl. Ryan * Probably X

Re: [racket] confusing error with keywords

2010-11-17 Thread Robby Findler
So far, I'm with Carl on this one. But perhaps you can explain what the bigger problem is? I will easily admit that I fall into this trap of seeing only the small problem. Robby On Wed, Nov 17, 2010 at 3:25 PM, Carl Eastlund wrote: > It's not clear to me that this is a symptom, or that you have

Re: [racket] confusing error with keywords

2010-11-17 Thread Carl Eastlund
On Wed, Nov 17, 2010 at 4:25 PM, Carl Eastlund wrote: > It's not clear to me that this is a symptom, or that you have > identified the right fundamental problem.  Function application is > another syntax -- I don't just mean we implement it as one, it is one. >  We allow it to vary with language j

Re: [racket] confusing error with keywords

2010-11-17 Thread Carl Eastlund
It's not clear to me that this is a symptom, or that you have identified the right fundamental problem. Function application is another syntax -- I don't just mean we implement it as one, it is one. We allow it to vary with language just like any other macro. The issue here is that part of #%app

Re: [racket] confusing error with keywords

2010-11-17 Thread Robby Findler
On Wed, Nov 17, 2010 at 3:15 PM, Matthias Felleisen wrote: > > Isn't the true problem that we pretend uniformity of syntax and values? In > this case, we specifically pretend that functions and syntaxes may consume > the same kind of keyword-labeled arguments. I don't think that this second sen

Re: [racket] confusing error with keywords

2010-11-17 Thread Matthias Felleisen
That's a fix for the symptom, and it occurred to me too. Let's try to look at the large picture, too, instead of just looking for bandaids for symptoms. On Nov 17, 2010, at 4:17 PM, Carl Eastlund wrote: > Personally I would like to see the error here be that > define-struct/contract is not b

Re: [racket] confusing error with keywords

2010-11-17 Thread Carl Eastlund
Personally I would like to see the error here be that define-struct/contract is not bound. If the order of either top level expansion or #%app worked slightly differently, we could get that error first and all would be clear. Carl Eastlund On Wed, Nov 17, 2010 at 4:15 PM, Matthias Felleisen wro

Re: [racket] confusing error with keywords

2010-11-17 Thread Matthias Felleisen
Isn't the true problem that we pretend uniformity of syntax and values? In this case, we specifically pretend that functions and syntaxes may consume the same kind of keyword-labeled arguments. Except that when you make a small mistake, the brittleness of this arrangement shows up and you get W

[racket] confusing error with keywords

2010-11-17 Thread Jon Rafkind
I found this error message confusing. The problem is I forgot to require racket/contract. #lang racket/base (define-struct/contract foo ([a any/c]) #:transparent) > application: missing argument expression after keyword at: #:transparent in: (#%app define-struct/contract foo ((a any/c)) #:transp