Hi, <br><br> I'm fresh to contracts. Here is my problem:<br><br>I just want to pass the contracts check on the following definition:<br><br> (define test (lambda (url)<br> (post-impure-port url data rhead)))
<br> <br>(provide/contract (test (-> url? input-port?)))<br><br>(call/input-url (string->url "<a href="https://210.77.16.29/php/user_login.php">https://210.77.16.29/php/user_login.php</a>") test display-pure-port)
<br><br>or even more simplified:<br><br>(call/input-url (string->url "<a href="https://210.77.16.29/php/user_login.php">https://210.77.16.29/php/user_login.php</a>") <br> (lambda (url)<br>
(post-impure-port url data rhead))) <br> display-pure-port)<br><br>Every time, I get:<br> (case-><br> (-><br> url?<br> (case-><br> (-> url? input-port?)
<br> (-> url? (listof string?) input-port?))<br> (-> input-port? any)<br> any)<br> (-><br> url?<br> (case-><br> (-> url? input-port?)<br> (-> url? (listof string?) input-port?))
<br> (-> input-port? any)<br> (listof string?)<br> any))<br>on call/input-url; expected a procedure that accepts 2 arguments, given: #<procedure:test><br><br>If I change the definition to <br>(call/input-url (string->url "
<a href="https://210.77.16.29/php/user_login.php">https://210.77.16.29/php/user_login.php</a>")<br> (lambda (url rhead)<br> (post-impure-port url data rhead)<br> )
<br> display-pure-port<br> )<br>. . ssl-url.scm:40:4: /home/yug/ssl-url.scm:40:4: top-level broke the contract <br> (case-><br> (-><br> url?<br> (case-><br> (-> url? input-port?)
<br> (-> url? (listof string?) input-port?))<br> (-> input-port? any)<br> any)<br> (-><br> url?<br> (case-><br> (-> url? input-port?)<br> (-> url? (listof string?) input-port?))
<br> (-> input-port? any)<br> (listof string?)<br> any))<br>on call/input-url; expected a procedure that accepts 1 arguments, given: #<procedure><br>><br><br>How can I define my function?<br><br>Thanks
<br clear="all"><br>-- <br>Gang