chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Problem with http-client egg sample code


From: Ulas Türkmen
Subject: Re: [Chicken-users] Problem with http-client egg sample code
Date: Thu, 24 May 2012 15:18:31 +0200

Hi Mario,
Thanks a lot for you quick response. This solved the problem.

Cheers,
Ulas

On Thu, May 24, 2012 at 1:59 PM, Mario Domenech Goulart
<address@hidden> wrote:
> Hi Ulas,
>
> On Thu, 24 May 2012 13:40:43 +0200 Ulas Türkmen <address@hidden> wrote:
>
>> For my next side project, I wanted to use Chicken to improve my
>> knowledge of Scheme, and to see how fast Chicken scheme can get. I
>> installed Chicken on my Mac (Snow Leopard) by compiling from source,
>> since the Macports version gave segmentation faults on installing
>> eggs. Afterwards, I installed the http egg (specifically, this one:
>> http://wiki.call-cc.org/eggref/3/http), and copied the test code for
>> the client into the file test.scm, whose contents look like this:
>>
>> #!/usr/local/bin/csi -s
>> (require-extension http-client)
>>
>> (define-values (h a i o) (http:send-request "http://google.com";))
>>
>> (pretty-print (http:read-body a i))
>> (close-input-port i)
>> (close-output-port o)
>>
>>
>> Afterwards, I ran ./test.scm in the command line, and got the
>> following error output:
>>
>> Error: unbound variable: http:send-request
>>
>>       Call history:
>>
>>       make-string
>>       make-parameter
>>       <syntax>          (define-values (h a i o) (http:send-request 
>> "http://google.com";))
>>       <syntax>          (##sys#call-with-values (##core#lambda ()
>> (http:send-request "http://google.com";)) (##core#lambda (h......
>>       <syntax>          (##core#lambda () (http:send-request 
>> "http://google.com";))
>>       <syntax>          (##core#begin (http:send-request 
>> "http://google.com";))
>>       <syntax>          (http:send-request "http://google.com";)
>>       <syntax>          (##core#lambda (h176 a177 i178 o179) (##core#set! h 
>> h176)
>> (##core#set! a a177) (##core#set! i i178) ...
>>       <syntax>          (##core#begin (##core#set! h h176) (##core#set! a 
>> a177)
>> (##core#set! i i178) (##core#set! o o179))
>>       <syntax>          (##core#set! h h176)
>>       <syntax>          (##core#set! a a177)
>>       <syntax>          (##core#begin (##core#set! i i178) (##core#set! o 
>> o179))
>>       <syntax>          (##core#set! i i178)
>>       <syntax>          (##core#set! o o179)
>>       <eval>    (##sys#call-with-values (##core#lambda () (http:send-request
>> "http://google.com";)) (##core#lambda (h......
>>       <eval>    (http:send-request "http://google.com";)       <--
>>
>>
>> What am I doing wrong here?
>
> It seems that you are using an egg from CHICKEN version 3, which is
> pretty old and not maintained anymore.  The /eggref/3 part in the URL
> indicates that it is a CHICKEN 3 egg.
>
> The current major version is 4.  You can get it from
> http://code.call-cc.org
>
> Check http://wiki.call-cc.org/eggref/4/http-client for the http-client
> for version 4 of CHICKEN.
>
> You can install it with:
>
>    $ chicken-install http-client
>
> `chicken-install' is the egg management tool for version 4.  If you have
> `chicken-setup', you have a CHICKEN version 3.
>
> I hope that helps.
>
>
> Best wishes.
> Mario
> --
> http://parenteses.org/mario



reply via email to

[Prev in Thread] Current Thread [Next in Thread]