Re: CGI scripting with Guile

2008-03-19 Thread Sebastian Tennant
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>: > () Sebastian Tennant <[EMAIL PROTECTED]> >Hmm, OK. Again, just out of interest, why doesn't a simple > > [EMAIL PROTECTED]@ -s > !# > >suffice? > > It probably would, in this case. For a (semi-)exhaustive > treatment of script header

Re: CGI scripting with Guile

2008-03-19 Thread Thien-Thi Nguyen
() Sebastian Tennant <[EMAIL PROTECTED]> () Tue, 18 Mar 2008 22:19:27 +0200 Hmm, OK. Again, just out of interest, why doesn't a simple [EMAIL PROTECTED]@ -s !# suffice? It probably would, in this case. For a (semi-)exhaustive treatment of script headers, see: http://www.gnuvol

Re: CGI scripting with Guile

2008-03-18 Thread Sebastian Tennant
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>: > () Sebastian Tennant <[EMAIL PROTECTED]> > () Sun, 16 Mar 2008 14:56:20 +0200 > >This is incredibly useful. Thank you for pointing it out. > > You're welcome. If you find any bugs in it, i'm all ears... I'll do my best... :-) >Just out of cu

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>: > () Sebastian Tennant <[EMAIL PROTECTED]> > () Sun, 16 Mar 2008 14:51:19 +0200 > > guile> (www:get "http://www.../hw.scm";) > "" > guile> (www:http-head-get "http://www.../hw.scm";) > #("HTTP/1.0" "200" "OK" ((server . "lighttpd/1.4.18")

Re: CGI scripting with Guile

2008-03-16 Thread Thien-Thi Nguyen
() Sebastian Tennant <[EMAIL PROTECTED]> () Sun, 16 Mar 2008 14:56:20 +0200 This is incredibly useful. Thank you for pointing it out. You're welcome. If you find any bugs in it, i'm all ears... Just out of curiostiy, why the '.in' file extension? Is it to do with make? It's customary

Re: CGI scripting with Guile

2008-03-16 Thread Thien-Thi Nguyen
() Sebastian Tennant <[EMAIL PROTECTED]> () Sun, 16 Mar 2008 14:51:19 +0200 guile> (www:get "http://www.../hw.scm";) "" guile> (www:http-head-get "http://www.../hw.scm";) #("HTTP/1.0" "200" "OK" ((server . "lighttpd/1.4.18") (date . "Sun, 16 Mar 2008 12:43:32 GMT") (content-le

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>: > Appended is examples/id.cgi.in This is incredibly useful. Thank you for pointing it out. Just out of curiostiy, why the '.in' file extension? Is it to do with make? > #!/bin/sh > exec @GUILE@ -s $0 "$@" # -*- scheme -*- > !# Also, why the shell?

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>: > What does the client see for the second case? #!/usr/bin/guile -s !# (use-modules (www cgi)) ;LOAD (cgi:init) ;INIT (simple-format #t "Content-Type: text/plain\r\n\r\n~A" "hello world") ---/--- guile> (ww

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>: >How is [CRLF] achieved (in scheme (lisp) forms)? > > You can use the characters #\cr and #\newline, or the string "\r\n". I can do that :-) > Probably `procedure-source' is a poor way to learn how `cgi:init' > works; better to look at cgi.scm dire

Re: CGI scripting with Guile

2008-03-16 Thread Thien-Thi Nguyen
() Sebastian Tennant <[EMAIL PROTECTED]> () Sun, 16 Mar 2008 02:41:39 +0200 How is [CRLF] achieved (in scheme (lisp) forms)? You can use the characters #\cr and #\newline, or the string "\r\n". In id.cgi.in, for example, we use the string variant. cgi:init is a little... dark... in terms o

Re: CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>: > What does the client see for the second case? I will use a Guile http request and hopefully then I'll be able to give you an intelligent answer. > I think both cases are malformed; IIRC, HTTP header lines need to end > in CRLF, not just LF. How is th

Re: CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
Quoth Sebastian Tennant <[EMAIL PROTECTED]>: > Quoth Sebastian Tennant <[EMAIL PROTECTED]>: >> The additional line works in a guile process running on the server. > > I should have said > > a guile REPL(?) shell like thing > > not just > > a guile process > This post was not a reply to _your_ l

Re: CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
Quoth Sebastian Tennant <[EMAIL PROTECTED]>: > The additional line works in a guile process running on the server. I should have said a guile REPL(?) shell like thing not just a guile process S

Re: CGI scripting with Guile

2008-03-15 Thread Thien-Thi Nguyen
() Sebastian Tennant <[EMAIL PROTECTED]> () Sun, 16 Mar 2008 00:10:11 +0200 #!/usr/bin/guile -s !# works. #!/usr/bin/guile -s !# (use-modules (www cgi)) doesn't. Why doesn't the second script work? What does the client see for the second case? I think both cases ar

CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
Hi list, This CGI script: #!/usr/bin/guile -s !# (display "Content-Type: text/plain hello world") works. But this CGI script: #!/usr/bin/guile -s !# (use-modules (www cgi)) (display "Content-Type: text/plain hello world") doesn't. Why doesn't the second script work? The additi