Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
On Tue, Nov 1, 2016 at 6:51 PM, Robby Findler wrote: > On Tue, Nov 1, 2016 at 2:06 PM, David Storrs > wrote: > >> It is a syntax error. > > > > > > Absolutely, but that's not what the message says. :> > > Yes, syntax errors in "#lang racket" and its variants don't come with > the word "syntax"

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Robby Findler
On Tue, Nov 1, 2016 at 2:06 PM, David Storrs wrote: >> It is a syntax error. > > > Absolutely, but that's not what the message says. :> Yes, syntax errors in "#lang racket" and its variants don't come with the word "syntax" in them, but you can tell because they happen before you run code (i.e.,

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
On Tue, Nov 1, 2016 at 2:52 PM, Robby Findler wrote: > > > On Tuesday, November 1, 2016, David Storrs wrote: > >> >> >> On Tue, Nov 1, 2016 at 12:58 PM, Robby Findler < >> ro...@eecs.northwestern.edu> wrote: >> >>> I wish I could see how to make a better error message for this input, >>> but I'm

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Robby Findler
On Tuesday, November 1, 2016, David Storrs wrote: > > > On Tue, Nov 1, 2016 at 12:58 PM, Robby Findler < > ro...@eecs.northwestern.edu > > wrote: > >> I wish I could see how to make a better error message for this input, >> but I'm not seeing it. Do you? >> >> Robby >> >> > With this function: >

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
On Tue, Nov 1, 2016 at 12:58 PM, Robby Findler wrote: > I wish I could see how to make a better error message for this input, > but I'm not seeing it. Do you? > > Robby > > With this function: (define/contract (register-functions . func-list) (->* () #:rest (listof procedure?) () any) I go

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Robby Findler
I wish I could see how to make a better error message for this input, but I'm not seeing it. Do you? Robby On Tue, Nov 1, 2016 at 11:50 AM, David Storrs wrote: > Aha. It's always the simple things that get you. Thanks, Alexis. > > On Tue, Nov 1, 2016 at 12:30 PM, Alexis King wrote: >> >> You

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
Aha. It's always the simple things that get you. Thanks, Alexis. On Tue, Nov 1, 2016 at 12:30 PM, Alexis King wrote: > You have the order wrong for ->*. The #:rest option should come > after the positional argument contracts, just before the return > contract. Since this function has no positi

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Alexis King
You have the order wrong for ->*. The #:rest option should come after the positional argument contracts, just before the return contract. Since this function has no positional optional arguments, you can either omit the optional positional argument contracts entirely: (->* () #:rest (listof pr

[racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
What would the correct contract for this function be? (define/contract (register-functions . func-list) (->* () #:rest (listof procedure?) () any) ;; this is wrong (for ((f func-list)) ...do something...)) I've read through the docs below and it doesn't make clear how to do it. https://