chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] How to do CGI stuffs?


From: Alejandro Forero Cuervo
Subject: Re: [Chicken-users] How to do CGI stuffs?
Date: Sun, 28 Dec 2008 02:18:38 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

> Alejandro Forero Cuervo wrote:
> >>On the other hand, I dislike the way cgi-stream doing its work.
> >
> >Why?
> >
> Just don't like the way it works. I prefer simply throw things out at 
> stdout.

So what's wrong with the following?

(cgi-main
  (lambda (get post cookies)
    (with-output-to-stream
      (lambda ()
        (format #t "Content-type: text/html~%~%<html><body><p>")
        (let ((name (get 'name)))
          (if (null? name)
            (format #t "Hello, stranger!")
            (format #t "Hello, <b>~A</b>!" (stream->string (car name)))))
        (format #t " And yet another thing I'm throwing at stdout! HA!")
        (format #t "</p></body></html>")))))

Hmm?

Alejo.
http://azul.freaks-unidos.net/




reply via email to

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