[plt-scheme] The contract

From: Robby Findler (robby at cs.uchicago.edu)
Date: Mon Dec 17 09:51:37 EST 2007

Ah, right. Redex v4 should work in both 371.3 and in v4, but I haven't
added a 3.x version of redex that is compatible with v4 plt scheme. My
thought was the v4 redex is a pretty small step from v3 redex, so it
wouldn't be worth the effort.

But if you need something from v4, I can try to back-patch the port to
a v3 redex.

Robby

On Dec 17, 2007 8:44 AM,  <yug at ios.ac.cn> wrote:
> I do not use the interface from net collection, Module "ssl-url" was
> provided by Jens,
>
> (call/input-url (opt->* (url?
>                             (opt-> (url?) ((listof string?)) input-port?)
>
>                             (input-port? . -> . any))
>                            ((listof string?))
>                            any))
>
>
> 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
>
>
>
>
>
> On Dec 17, 2007 10:34 PM, Robby Findler <robby at cs.uchicago.edu> wrote:
> > Oh, one other point. It was pointed out earlier that the function does
> > not actually need that strict of a contract and I believe the contract
> > has been relaxed in SVN.
> >
> > Robby
> >
> >
> >
> >
> > On Dec 17, 2007 8:22 AM,  <yug at ios.ac.cn> wrote:
> > > Thanks!! Robby
> > >
> > > The right def is
> > >
> > >
> > > (call/input-url (string->url " https://210.77.16.29/php/user_login.php")
> > >                   (case-lambda
> > >                      [(url) (post-impure-port url data rhead)]
> > >                     [(url rhead) (post-impure-port url data rhead)])
> > >                   display-pure-port
> > >                   )
> > >
> > >
> > >
> > >  On Dec 17, 2007 10:15 PM, Robby Findler < robby at cs.uchicago.edu> wrote:
> > > > The contract is insisting that you provide a function that accepts
> > > > *both* one argument and two arguments.
> > > >
> > > > Robby
> > > >
> > > >
> > > >
> > > >
> > > > On Dec 17, 2007 8:13 AM,  < yug at ios.ac.cn> wrote:
> > > > > Hi,
> > > > >
> > > > >   I'm fresh to contracts. Here is my problem:
> > > > >
> > > > > I just want to pass the contracts check on the following definition:
> > > > >
> > > > >  (define test (lambda (url)
> > > > >                  (post-impure-port url data rhead)))
> > > > >
> > > > > (provide/contract (test (-> url? input-port?)))
> > > > >
> > > > > (call/input-url (string->url "
> https://210.77.16.29/php/user_login.php")
> > > test
> > > > > display-pure-port)
> > > > >
> > > > > or even more simplified:
> > > > >
> > > > > (call/input-url (string->url "
> https://210.77.16.29/php/user_login.php")
> > > > >                    (lambda (url)
> > > > >                        (post-impure-port url data rhead)))
> > > > >                   display-pure-port)
> > > > >
> > > > > Every time, I get:
> > > > >   (case->
> > > > >     (->
> > > > >      url?
> > > > >      (case->
> > > > >        (-> url? input-port?)
> > > > >        (-> url? (listof string?) input-port?))
> > > > >      (-> input-port? any)
> > > > >      any)
> > > > >     (->
> > > > >      url?
> > > > >      (case->
> > > > >        (-> url? input-port?)
> > > > >        (-> url? (listof string?) input-port?))
> > > > >      (-> input-port? any)
> > > > >      (listof string?)
> > > > >      any))
> > > > > on call/input-url; expected a procedure that accepts 2 arguments,
> given:
> > > > > #<procedure:test>
> > > > >
> > > > > If I change the definition to
> > > > > (call/input-url (string->url "
> https://210.77.16.29/php/user_login.php")
> > > > >                   (lambda (url rhead)
> > > > >                     (post-impure-port url data rhead)
> > > > >                     )
> > > > >                   display-pure-port
> > > > >                   )
> > > > > . . ssl-url.scm:40:4: /home/yug/ssl-url.scm:40:4: top-level broke
> the
> > > > > contract
> > > > >   (case->
> > > > >     (->
> > > > >      url?
> > > > >      (case->
> > > > >        (-> url? input-port?)
> > > > >        (-> url? (listof string?) input-port?))
> > > > >      (-> input-port? any)
> > > > >      any)
> > > > >     (->
> > > > >      url?
> > > > >      (case->
> > > > >        (-> url? input-port?)
> > > > >        (-> url? (listof string?) input-port?))
> > > > >      (-> input-port? any)
> > > > >      (listof string?)
> > > > >      any))
> > > > > on call/input-url; expected a procedure that accepts 1 arguments,
> given:
> > > > > #<procedure>
> > > > > >
> > > > >
> > > > > How can I define my function?
> > > > >
> > > > > Thanks
> > > > >
> > > > > --
> > > > > Gang
> > > > > _________________________________________________
> > > > >   For list-related administrative tasks:
> > > > >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > > > >
> > > > >
> > > > _________________________________________________
> > > >  For list-related administrative tasks:
> > > >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > > >
> > >
> > >
> > >
> > > --
> > > Gang
> > _________________________________________________
> >  For list-related administrative tasks:
> >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
>
>
>
> --
> Gang


Posted on the users mailing list.