Re: [racket-users] Contracts referring to earlier elements?

2019-07-18 Thread Sorawee Porncharoenwase
Hi Kevin, Take a look at Racket Guide’s Argument and Result Dependencies and/or Racket Reference’s ->i

Re: [racket-users] Contracts referring to earlier elements?

2019-07-18 Thread Robby Findler
This is what ->i is for. The syntax of define/contract is slightly misleading because it appears to place the contracts in scope of the arguments but, as you notice, it doesn't. Happily ->i lets you give another name to the argument and then you can use that one. Robby On Thu, Jul 18, 2019 at

[racket-users] Contracts referring to earlier elements?

2019-07-18 Thread Kevin Forchione
Hi guys, This is a little tricky to explain, so I’ll give a small example: [define/contract [foo x) (-> integer? not-x/c) body …) In this case the not-x/c is what I’m asking about. Some way that the contract can refer to a previous argument value? Ordinarily this would be a predicate, but the