Permalink
Browse files

fix examples

  • Loading branch information...
1 parent 47a3713 commit f4fe75ff016a1047b548cc4140fbc8910c924f0e @archimag committed Feb 9, 2011
Showing with 29 additions and 29 deletions.
  1. +8 −8 example/example-1.lisp
  2. +13 −13 example/example-2.lisp
  3. +8 −8 example/example-3.lisp
View
@@ -5,23 +5,23 @@
;;;;
;;;; Author: Moskvitin Andrey <archimag@gmail.com>
-(asdf:operate 'asdf:load-op :cl-who)
-(asdf:operate 'asdf:load-op :restas)
+(asdf:operate 'asdf:load-op '#:cl-who)
+(asdf:operate 'asdf:load-op '#:restas)
-(restas:define-module :restas.example-1
- (:use :cl))
+(restas:define-module #:restas.example-1
+ (:use #:cl))
-(in-package :restas.example-1)
+(in-package #:restas.example-1)
-(define-route main ("" :method :get)
+(restas:define-route main ("" :method :get)
(who:with-html-output-to-string (out)
(:html
(:body
((:form :method :post)
((:input :name "message"))
((:input :type "submit" :value "Send")))))))
-(define-route main/post ("" :method :post)
+(restas:define-route main/post ("" :method :post)
(who:with-html-output-to-string (out)
(:html
(:body
@@ -30,4 +30,4 @@
(hunchentoot:post-parameter "message"))))
((:a :href (restas:genurl 'main)) "Try again")))))
-(restas:start :restas.example-1 :port 8080)
+(restas:start '#:restas.example-1 :port 8080)
View
@@ -6,15 +6,15 @@
;;;; Author: Moskvitin Andrey <archimag@gmail.com>
-(asdf:operate 'asdf:load-op :cl-who)
-(asdf:operate 'asdf:load-op :restas)
+(asdf:operate 'asdf:load-op '#:cl-who)
+(asdf:operate 'asdf:load-op '#:restas)
-(restas:define-module :restas.example-2
- (:use :cl :iter))
+(restas:define-module #:restas.example-2
+ (:use #:cl #:iter))
-(in-package :restas.example-2)
+(in-package #:restas.example-2)
-(define-route root ("")
+(restas:define-route root ("")
(who:with-html-output-to-string (out)
(:html
(:head
@@ -24,10 +24,10 @@
(:ul
(iter (for x from 1 to 10)
(who:htm (:li
- ((:a :href (genurl 'chapter-?.html :id x))
+ ((:a :href (restas:genurl 'chapter-?.html :id x))
(who:fmt "Chapter ~A" x))))))))))
-(define-route chapter-?.html ("chapter-:(id).html")
+(restas:define-route chapter-?.html ("chapter-:(id).html")
(who:with-html-output-to-string (out)
(:html
(:head
@@ -37,20 +37,20 @@
(:ul
(iter (for x from 1 to 10)
(who:htm (:li
- ((:a :href (genurl 'chapter-?-?.html :id1 id :id2 x))
+ ((:a :href (restas:genurl 'chapter-?-?.html :id1 id :id2 x))
(who:fmt "Chapter ~A-~A" id x))))))
- ((:a :href (genurl 'root))
+ ((:a :href (restas:genurl 'root))
"Back to Index")))))
-(define-route chapter-?-?.html ("chapter-:(id1)-:(id2).html")
+(restas:define-route chapter-?-?.html ("chapter-:(id1)-:(id2).html")
(who:with-html-output-to-string (out)
(:html
(:head
(:title (who:fmt "Example 2. Chapter ~A-~A" id1 id2)))
(:body
(:h1 (who:fmt "Chapter ~A-~A" id1 id2))
(:p (who:fmt "This is a chapter ~A-~A" id1 id2))
- ((:a :href (genurl 'chapter-?.html :id id1))
+ ((:a :href (restas:genurl 'chapter-?.html :id id1))
(who:fmt "Back to Chapter ~A" id1))))))
-(restas:start :restas.example-2 :port 8080)
+(restas:start '#:restas.example-2 :port 8080)
View
@@ -5,15 +5,15 @@
;;;;
;;;; Author: Moskvitin Andrey <archimag@gmail.com>
-(asdf:operate 'asdf:load-op :cl-who)
-(asdf:operate 'asdf:load-op :restas)
+(asdf:operate 'asdf:load-op '#:cl-who)
+(asdf:operate 'asdf:load-op '#:restas)
-(restas:define-module :restas.example-3
- (:use :cl))
+(restas:define-module #:restas.example-3
+ (:use #:cl))
-(in-package :restas.example-3)
+(in-package #:restas.example-3)
-(define-route main ("" :method :get)
+(restas:define-route main ("" :method :get)
(who:with-html-output-to-string (out)
(:html
(:body
@@ -25,7 +25,7 @@
((:input :type "submit"
:value "Send")))))))
-(define-route main/post ("" :method :post)
+(restas:define-route main/post ("" :method :post)
(let ((file-info (hunchentoot:post-parameter "file")))
(if file-info
(who:with-html-output-to-string (out)
@@ -44,4 +44,4 @@
((:a :href (restas:genurl 'main)) "Try again"))))
(restas:redirect 'main))))
-(restas:start :restas.example-3 :port 8080)
+(restas:start '#:restas.example-3 :port 8080)

0 comments on commit f4fe75f

Please sign in to comment.