Changeset 12879 in project for wiki/stream-cgi


Ignore:
Timestamp:
12/26/08 14:24:13 (12 years ago)
Author:
azul
Message:

Changes applied for azul (193.142.125.1) through svnwiki:

Another example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/stream-cgi

    r12878 r12879  
    2727              (body (p "Hello, " (b (car name)))))))))))
    2828</enscript>
     29
     30This is another way to do the same:
     31
     32<enscript highlight=scheme>
     33(use stream-cgi stream-ext)
     34
     35(cgi-main
     36  (lambda (get post cookies)
     37    (with-output-to-stream
     38      (lambda ()
     39        (format #t "Content-type: text/html~%~%<html><body><p>")
     40        (let ((name (get 'name)))
     41          (if (null? name)
     42            (format #t "Hello, stranger!")
     43            (format #t "Hello, <b>~A</b>" (stream->string (car name)))))
     44        (format #t "</p></body></html>")))))
     45</enscript>
     46
    2947
    3048== Authors
Note: See TracChangeset for help on using the changeset viewer.