Permalink
Browse files

Destructuring problem tweaked again

  • Loading branch information...
dbyrne committed Apr 23, 2011
1 parent 91ca821 commit 95707b7429f85ee23c85c1039ec3d555379fabe1
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/foreclojure/data_set.clj
@@ -518,13 +518,20 @@
:title "Advanced Destructuring"
:times-solved 0
:description "Here is an example of some more sophisticated destructuring."
- :tags ["medium" "destructuring"]
- :tests ["(= __ (let [[a b & c :as d] [1 2 3 4 5]] [a b c d]))"]})
+ :tags ["easy" "destructuring"]
+ :tests ["(= [1 2 [3 4 5] [1 2 3 4 5]] (let [[a b & c :as d] __] [a b c d]))"]})
(insert! :problems
{:_id 52
:title "Intro to Destructuring"
:times-solved 0
:description "Let bindings and function parameter lists support destructuring."
:tags ["easy" "destructuring"]
- :tests ["(= [2 4] (let [[a b c d e f g] (range)] __))"]})))
+ :tests ["(= [2 4] (let [[a b c d e f g] (range)] __))"]})))
+
+
+(doseq [{id :_id :keys [test secrets]}
+ (fetch :problems)]
+ (update! :problems
+ {:_id id}
+ {:$set {:test (concat test secrets) :secrets []}}))

0 comments on commit 95707b7

Please sign in to comment.