I do not use the interface from net collection, Module "ssl-url" was provided by Jens,<br><br>(call/input-url (opt->* (url?<br> (opt-> (url?) ((listof string?)) input-port?)<br> (input-port? . -> . any))
<br> ((listof string?))<br> any))<br><br><br>BTW, I have tried several times to upgrade to current SVN, but the redex code (3.28) I wrote on version 371 could not run anymore on
3.99 or later. So I prefer staying on 371.2<br><br><br><br><div class="gmail_quote">On Dec 17, 2007 10:34 PM, Robby Findler <<a href="mailto:robby@cs.uchicago.edu">robby@cs.uchicago.edu</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Oh, one other point. It was pointed out earlier that the function does<br>not actually need that strict of a contract and I believe the contract<br>has been relaxed in SVN.<br><font color="#888888"><br>Robby<br></font><div>
<div></div><div class="Wj3C7c"><br>On Dec 17, 2007 8:22 AM, <<a href="mailto:yug@ios.ac.cn">yug@ios.ac.cn</a>> wrote:<br>> Thanks!! Robby<br>><br>> The right def is<br>><br>><br>> (call/input-url (string->url "
<a href="https://210.77.16.29/php/user_login.php" target="_blank">https://210.77.16.29/php/user_login.php</a>")<br>> (case-lambda<br>> [(url) (post-impure-port url data rhead)]
<br>> [(url rhead) (post-impure-port url data rhead)])<br>> display-pure-port<br>> )<br>><br>><br>><br>> On Dec 17, 2007 10:15 PM, Robby Findler <
<a href="mailto:robby@cs.uchicago.edu">robby@cs.uchicago.edu</a>> wrote:<br>> > The contract is insisting that you provide a function that accepts<br>> > *both* one argument and two arguments.<br>> ><br>
> > Robby<br>> ><br>> ><br>> ><br>> ><br>> > On Dec 17, 2007 8:13 AM, < <a href="mailto:yug@ios.ac.cn">yug@ios.ac.cn</a>> wrote:<br>> > > 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" target="_blank">
https://210.77.16.29/php/user_login.php</a>")<br>> test<br>> > > 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" target="_blank">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:<br>> > > #<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" target="_blank">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<br>> > > 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:<br>> > > #<procedure><br>> > > ><br>
> > ><br>> > > How can I define my function?<br>> > ><br>> > > Thanks<br>> > ><br>> > > --<br>> > > Gang<br>> > > _________________________________________________
<br>> > > For list-related administrative tasks:<br>> > > <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>> > >
<br>> > ><br>> > _________________________________________________<br>> > For list-related administrative tasks:<br>> > <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>> ><br>><br>><br>><br>> --<br>> Gang<br>_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>Gang