From fa50b9f7bf153754fd4111e19663c57ec612d919 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sun, 15 Apr 2012 20:51:12 -0700 Subject: [PATCH] Minor tidying up in the examples. Remove non-Leiningen install instructions. It's a start. The whole README needs updating / replacing since the classpath issue is best addressed a different way altogether now. --- README.md | 24 ++++++------------------ advanced/index.cfm | 4 ++-- basic/index.cfm | 21 ++++++++++++--------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5e8b687..7e0e1db 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,12 @@ To use cfmljure, you need the Clojure libraries. I think the easiest way to do that is with Leiningen, the Clojure build tool. -**Note: cfmljure.cfc requires Adobe ColdFusion 9.0.1 or Railo 3.2.2** +**Note: cfmljure.cfc requires Adobe ColdFusion 9.0.1 or Railo 3.2.2; + Because of the way Adobe ColdFusion deals with arrays of numbers, + many of the examples do not run as-is - but they run fine on Railo + so I'd recommend you try Railo if you want to play with cfmljure.** -## Installation with Leiningen +## Installation (with Leiningen) Install the **lein** script from http://github.com/technomancy/leiningen (download the **lein** script, make it executable, run **lein self-install** to complete @@ -27,21 +30,6 @@ In your **WEB-INF** folder, create a **classes** folder and copy **clj/cfml** and **clj/task** to that **classes** folder. Restart your CFML engine. Now go hit the cfmljure **index.cfm** file in your browser! -## Installation without Leiningen - -If you really don't want to mess with Leiningen, you can install Clojure manually. However, without Leiningen -you're not going to be able to run the tests and build JAR files etc so I strongly recommend the first installation -approach above. - -Download the Clojure libraries from here: http://clojure.org/downloads - -Download both Clojure and Clojure Contrib and unzip them. Copy **clojure.jar** (from the clojure-1.2.0.zip) -and **clojure-contrib-1.2.0.jar** (from the target subfolder of clojure-contrib-1.2.0.zip) to your classpath. -I put them in **{tomcat}/lib** - and restart your CFML engine. You can ignore the rest of those ZIP files. - -Copy the **clj/** folder contents from the cfmljure project to your server's **WEB-INF/classes** folder (or create a symbolic link) -and restart your CFML engine. Now go hit the cfmljure **index.cfm** file in your browser! - # Your Clojure Code Your Clojure code also needs to be on your classpath. @@ -165,4 +153,4 @@ variable via the **.\_()** API. Calling **_reference_.\_()** will return the und If you have a reference to a namespace, you also can get an underlying Clojure entity by name via the **\_()** API or *_name()* implicit function. Calling **_namespace_.\_( _name_ )** or **_namespace_.\__name_()** is identical to calling **_namespace_.get( _name_ ).\_()** so this is the more convenient API when you're -working with namespaces or an installed Clojure configuration. \ No newline at end of file +working with namespaces or an installed Clojure configuration. diff --git a/advanced/index.cfm b/advanced/index.cfm index 67aff6f..82420c2 100644 --- a/advanced/index.cfm +++ b/advanced/index.cfm @@ -12,11 +12,11 @@ (times_2 42) = #cfml.examples.times_2( 42 )#
- + (map times_2 [ 4 5 6 ]) = #n#
- + x = #n#
diff --git a/basic/index.cfm b/basic/index.cfm index a918142..732b8e4 100644 --- a/basic/index.cfm +++ b/basic/index.cfm @@ -64,31 +64,34 @@ (times_2 42) = #cfml.examples.times_2( 42 )#
- + (map times_2 [ 4 5 6 ]) = #n#
- + x = #n#
Time taken: #end - start#ms.
- // 3. Call Clojure by configuration and installation: - + start = getTickCount(); + namespaces = 'cfml.examples, clojure.core'; target = { }; // normally you'd target a scope - this is just an example // install the configuration to the target 'scope': clj.install( namespaces, target ); + end = getTickCount(); + writeOutput( '

Calls via implicit method lookup after installation to a target scope

' ); + writeOutput( 'Time taken for install: #end - start#ms.

' ); + + start = getTickCount();
-

Calls via implicit method lookup after installation to a target scope

- (greet "World") = #target.cfml.examples.greet( 'World' )#
@@ -99,13 +102,13 @@ (times_2 42) = #target.cfml.examples.times_2( 42 )#
- + (map times_2 [ 4 5 6 ]) = #n#
- + x = #n#
Time taken: #end - start#ms.
-
\ No newline at end of file +