Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Clojure.pdf
Скачиваний:
17
Добавлен:
09.05.2015
Размер:
12.92 Mб
Скачать

FAREWELL 283

What happens if a file is not found? serve-file returns nil. The or form then returns :next, which directs Compojure to continue searching for a matching handler. The catchall handler will then report that the page was not found.

Make sure that you have the most recent version of your reader.snippetserver loaded and try creating some snippets. You should now see titles on every page, and the snippets should have syntax coloring.

The completed code for the snippet server is in the file code/examples/ server/complete.clj.

You can run the completed example with the following commands. On Windows:

bin\snippet-solution.bat

On *nix:

bin/snippet-solution.sh

Weighing in at less than 50 lines, the snippet server provides the entire Controller and View layers for the snippet application.

9.4 Farewell

Congratulations. You have come a long way in a short time. You have learned the many ideas that combine to make Clojure great: Lisp, Java, functional programming, and explicit concurrency. And in this chapter, you have seen a brief sample of how the Clojure community is using Clojure for a variety of tasks: automated testing, data access, and web development.

We have only scratched the surface of Clojure’s great potential, and I hope you will take the next step and become an active part of the Clojure community. Join the mailing list.11 Hang out on IRC.12 The Clojure community is friendly and welcoming, and we would love to hear from you.

11.http://groups.google.com/group/clojure

12.#clojure

Prepared exclusively for WG Custom Motorcycles

Report erratum

this copy is (P1.0 printing, May 2009)