Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 11, 2019, at 12:34 PM, Alex Knauth wrote: > > > >> On Jul 11, 2019, at 1:15 PM, Kevin Forchione > > wrote: >> >>> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen >> > wrote: >>> >>> [(contract (-> string? integer?) (λ (x) x)

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Alex Knauth
> On Jul 11, 2019, at 1:15 PM, Kevin Forchione wrote: > >> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen >> wrote: >> >> [(contract (-> string? integer?) (λ (x) x) 'a 'b) >> "hello”] > > By the way, I’ve been playing around with this (and define/contract) and it > seems that ‘a in the

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen > wrote: > > > [(contract (-> string? integer?) (λ (x) x) 'a 'b) > "hello”] By the way, I’ve been playing around with this (and define/contract) and it seems that ‘a in the above refers to the function itself, while to the best of my

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen > wrote: > > > [(contract (-> string? integer?) (λ (x) x) 'a 'b) > "hello”] Incidentally, I’m not sure why, it must be something to do with the way I take apart and put together the world (i.e. the way I “learn” :) , but until a few posts

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen > wrote: > > > [(contract (-> string? integer?) (λ (x) x) 'a 'b) > "hello”] > Nice! Thanks! Kevin -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and

Re: [racket-users] Contracts in lambda?

2019-07-10 Thread Matthias Felleisen
[(contract (-> string? integer?) (λ (x) x) 'a 'b) "hello”] > On Jul 10, 2019, at 10:11 PM, Kevin Forchione wrote: > > Hi guys, > Is there a way to apply contracts to a lambda without associating it with an > identifier? What I want is to be able to pass lambda functions around without >

[racket-users] Contracts in lambda?

2019-07-10 Thread Kevin Forchione
Hi guys, Is there a way to apply contracts to a lambda without associating it with an identifier? What I want is to be able to pass lambda functions around without having to bind them to a symbol. I could use raise-argument-error/ raise-result-error but the contract system is more powerful and