Skip to content

Commit

Permalink
Make data_set non-side-effect-y unless you call one of its functions,…
Browse files Browse the repository at this point in the history
… and adjust load_data.{sh,bat} accordingly
  • Loading branch information
amalloy committed May 19, 2011
1 parent fd92533 commit 0402c22
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion load-data.bat
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off @echo off
for /f %%a in ('lein classpath') do @set project_classpath=%%a for /f %%a in ('lein classpath') do @set project_classpath=%%a
java -cp %project_classpath% clojure.main .\src\foreclojure\data_set.clj java -cp %project_classpath% clojure.main -i .\src\foreclojure\mongo.clj -e "(use 'foreclojure.mongo) (prepare-mongo) (shutdown-agents)"
2 changes: 1 addition & 1 deletion load-data.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
project_classpath=`lein classpath` project_classpath=`lein classpath`
echo $project_classpath echo $project_classpath
java -cp $project_classpath clojure.main ./src/foreclojure/data_set.clj java -cp $project_classpath clojure.main -i ./src/foreclojure/mongo.clj -e "(use 'foreclojure.mongo) (prepare-mongo) (shutdown-agents)"
5 changes: 0 additions & 5 deletions src/foreclojure/data_set.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@


(defn load-problems [] (defn load-problems []
(do (do
(mongo! :db :mydb)

(insert! :seqs (insert! :seqs
{:_id "problems" {:_id "problems"
:seq 87}) :seq 87})

(insert! :problems (insert! :problems
{:_id 1 {:_id 1
:title "Nothing but the Truth" :title "Nothing but the Truth"
Expand Down Expand Up @@ -1014,5 +1011,3 @@ number of prime numbers."
"(= (__ 1 2 10 100 1300) '(= (* (+ 1 2 10) 100) 1300)"]}) "(= (__ 1 2 10 100 1300) '(= (* (+ 1 2 10) 100) 1300)"]})


)) ))

(load-problems)

0 comments on commit 0402c22

Please sign in to comment.