Changes between Version 66 and Version 67 of Clojure Client Tutorial
- Timestamp:
- Aug 22, 2011 12:06:54 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Clojure Client Tutorial
v66 v67 28 28 * Pattern Matching and Predicate Dispatch [https://github.com/swannodette/match] 29 29 * Logic Programming [https://github.com/clojure/core.logic] 30 * Thread Scheduling [https://github.com/overtone/at-at] 30 31 31 32 Lisp and Scheme resources: … … 56 57 Once you have lieningen setup, cd to the client directory and type "tree" into the shell. 57 58 58 This organization is the default for the leiningen projects created with the "lein new <myprojectname>" command.59 This organization is the default for the leiningen projects created with the "lein new" command. 59 60 60 61 docs contains and html file that provides a sort of annotated presentation of the code. Read this file first to familiarize yourself with the organization of the project. Once you have made your own changes to the client and wish to update the documentation, run "lein marg" in the top level directory. This invokes the marginalia jar in the lib directory and generates a new html file. … … 62 63 In the top level directory there is a file called "project.clj". This file tells leiningen how your project is organized. For details, consult the tutorial, but know that if you wish to add additional clojure libraries to your project, you will need to specify them here, and run "lein deps" to download them. Specific directions for leiningen are provided nearly universally for clojure project, so just look them up as needed. 63 64 64 src contains all of the clj files in your project. The organization of the directory must correspond to the namespaces of your project so edit with care (more on this later, but one thing to note is that if you have a namespace with dash in it, "client.my-ns", for example, the actual filename must be "my_ns.clj" and it must be located in the client directory). 65 {{{ 66 (defproject client "1.0.0-SNAPSHOT" 67 :description "Quagents client" 68 :url "http://www.cs.rochester.edu/trac/quagents/wiki/WikiStart" 69 :dependencies [[org.clojure/clojure "1.2.1"] 70 [org.clojure/clojure-contrib "1.2.0"] 71 [org.clojars.automata/rosado.processing "1.1.0"] 72 [overtone/at-at "0.0.1"] 73 [org.clojure/core.logic "0.6.2"] 74 [match "0.1.0-SNAPSHOT"]] 75 :dev-dependencies [[lein-marginalia "0.6.0"]] 76 :main client.core) 77 }}} 78 79 src contains all of the .clj files in your project. The organization of the directory must correspond to the namespaces of your project so edit with care (more on this later, but one thing to note is that if you have a namespace with dash in it, "client.my-ns", for example, the actual filename must be "my_ns.clj" and it must be located in the client directory). 65 80 66 81 test contains files that leiningen will use for testing your functions via the "lein test" command. This functionality is not critical in clojure since you can debug easily from the REPL, but if you want to batch test functions then you can look into this. … … 73 88 74 89 === Basic Functionality === 75 Now it is time to learn to use the client. cd to the top level directory and typu "lein repl". If everything went smoothly you'll see something about no rlwrap and the prompt.90 Now it is time to learn to use the client. cd to the top level directory and typu "lein repl". If everything went smoothly you'll see something about no rlwrap (if you are working on one of the lab machines) and the prompt. 76 91 77 92 {{{ … … 103 118 }}} 104 119 105 Since Ialready have the path predefined, however, this will also work:120 If you already have the path predefined, however, this will also work: 106 121 107 122 {{{ … … 126 141 }}} 127 142 128 Let's load a quagent into the map (note that if there is only one spawnpoint on the map, you'll want to move forward a bit in order to avoid getting telefragged).143 Note that if there is only one spawnpoint on the map, you'll want to move forward a bit in order to avoid getting telefragged. 129 144 130 145 {{{