Re: [racket] Macro in typed racket

2014-10-07 Thread Jack Firth
Sorry for the private email instead of public, I always seem to miss the reply-all button. I did get it to work, but it felt off. If it were to actually be added to typed racket, it might be better to have some sort of standalone form like (define-type-arg-convention number Number) which lets all y

Re: [racket] Macro in typed racket

2014-10-07 Thread Matthias Felleisen
We exchange email off-line and Jack figured out what he wanted. It might be neat to add it to TR. On Oct 7, 2014, at 9:24 PM, Alexander D. Knauth wrote: > > On Oct 7, 2014, at 2:38 PM, Jack Firth wrote: > >> I read a tweet about someone wistfully wishing there was some sort of "the" >

Re: [racket] Macro in typed racket

2014-10-07 Thread Alexander D. Knauth
On Oct 7, 2014, at 2:38 PM, Jack Firth wrote: > I read a tweet about someone wistfully wishing there was some sort of "the" > operator in a typed non-parensy language such that one could write something > like this: > > Customer someFunc(the customer) { ... } > > and have it mean: > >

Re: [racket] Macro in typed racket

2014-10-07 Thread Hendrik Boom
On Tue, Oct 07, 2014 at 11:38:43AM -0700, Jack Firth wrote: > I read a tweet about someone wistfully wishing there was some sort of "the" > operator in a typed non-parensy language such that one could write > something like this: > > Customer someFunc(the customer) { ... } > > and have it mea

Re: [racket] Macro in typed racket

2014-10-07 Thread Matthias Felleisen
Will this help: #lang typed/racket (define-syntax (the stx) (syntax-case stx () [(_ (define (f x) e)) (let ((capital-x (capitalize stx #'x))) #`(begin (: f (-> #,capital-x #,capital-x)) (define (f x) e)))])) (define-for-syntax (capitalize stx x)

[racket] Macro in typed racket

2014-10-07 Thread Jack Firth
I read a tweet about someone wistfully wishing there was some sort of "the" operator in a typed non-parensy language such that one could write something like this: Customer someFunc(the customer) { ... } and have it mean: Customer someFunc(Customer customer) { ... } Basically, an operat