Dessa forma, basta executar o arquivo com a aplicação web como se fosse um arquivo executável qualquer:
$ cat hello-world.scm
#! /usr/bin/awful
(use awful)
(define-page (main-page-path)
(lambda ()
"Hello, world!"))
$ ./hello-word.scm
$ cat hello-world.scm
#! /usr/bin/awful
(use awful)
(define-page (main-page-path)
(lambda ()
"Hello, world!"))
$ ./hello-word.scm
(define (make-obj)
(lambda (message)
(case message
((hello) "Hello!")
((bye) "Bye bye!")
(else (error "Unknown message.")))))
(define make-obj
(lambda ()
(lambda (message)
(case message
((hello) "Hello!")
((bye) "Bye bye!")
(else (error "Unknown message."))))))
(define ((make-obj) message)
(case message
((hello) "Hello!")
((bye) "Bye bye!")
(else (error "Unknown message."))))
chicken-doc
:
$ chicken-doc
usage: chicken-doc -s|-c|-i path
chicken-doc -f id
chicken-doc -m re
chicken-doc id | path
-s path Show signature
-c path Show table of contents (child IDs)
-i path Show documentation
-f id Show all matching paths for ID
where ID is a single identifier and PATH is zero or
more IDs comprising a path from the documentation root,
separated by spaces or the # character.
-m re Show all matching paths for RE
where RE is a POSIX regular expression. Similar to -f.
When no option is given, guess the user's intent. With
a single ID, find the ID (as with -f) and show its
documentation (as with -i) or show all matching paths
if multiple matches exist. If more than one ID is
provided, show documentation on the path (as with -i).
Examples:
-f open/rdonly # Show matches for open/rdonly
-s posix open/rdonly # Show signature of open/rdonly in Unit posix
-s 9p open/rdonly # Show signature of open/rdonly in 9p egg
-i 9p#open/rdonly # Show documentation for same
-c posix # Show TOC for Unit posix
-c # Show toplevel TOC
-m call- # Show identifiers containing call-
-m -file$ # Show identifiers ending in -file
use # Show doc for "use" in chicken core
posix # Show doc for Unit posix
open/rdonly # Show matches for open/rdonly
posix open/rdonly # Show doc for open/rdonly in Unit posix
$ chicken-doc reverse
path: (scheme reverse)
-- procedure: (reverse list)
Returns a newly allocated list consisting of the elements of list in
reverse order.
(reverse '(a b c)) ===> (c b a)
(reverse '(a (b c) d (e (f))))
===> ((e (f)) d (b c) a)
scheme
(indicando que é o símbolo é um componente da especificação da linguagem), o nome de uma unit de Chicken, uma SRFI ou uma extensão. É possível que ele possa ser encontrado em mais de um módulo. Neste caso, chicken-doc
apresenta uma lista de opções:
$ chicken-doc enable-db
Found 3 matches:
(awful-sql-de-lite enable-db) (enable-db)
(awful-sqlite3 enable-db) (enable-db)
(awful-postgresql enable-db) (enable-db)
$ chicken-doc awful-postgresql enable-db
-- procedure: (enable-db)
Enable Postgresql support for awful
(http://chicken.wiki.br/eggref/4/awful). This procedure basically sets
up awful to use the connection, disconnection, query and query escaping
procedures for Postgresql databases.
$ chicken-doc -m '^string->'
(library string->blob) (string->blob STRING)
(byte-blob string->byte-blob) (string->byte-blob STRING) => BYTE-BLOB
(sxml-transforms string->goodHTML) (string->goodHTML html)
(library string->keyword) (string->keyword STRING)
(scheme string->list) (string->list string)
(scheme string->number) (string->number string radix)
(scheme string->symbol) (string->symbol string)
(posix string->time) (string->time TIME [FORMAT])
(library string->uninterned-symbol) (string->uninterned-symbol STRING)
-m
é uma expressão regular.
$ csi
CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.4.4
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2010-03-30 on dellito (Linux)
; loading ./.csirc ...
csi> (use chicken-doc)
csi> ,doc string-intersperse
path: (data-structures string-intersperse)
-- procedure: (string-intersperse LIST [STRING])
Returns a string that contains all strings in `LIST` concatenated together.
`STRING` is placed between each concatenated string and defaults to `" "`.
(string-intersperse '("one" "two") "three")
is equivalent to
(apply string-append (intersperse '("one" "two") "three"))
csi> ,wtf concatenate
(srfi-1 concatenate) (concatenate list-of-lists) -> value
(srfi-1 concatenate!) (concatenate! list-of-lists) -> value
(ports make-concatenated-port) (make-concatenated-port PORT1 PORT2 ...)
,doc
mostra a documentação do símbolo dado como argumento. O comando ,wtf
(de where to find ;-)) é equivalente à opção de linha de comando -m
de chicken-doc
.