Skip to content

Commit

Permalink
removed deref
Browse files Browse the repository at this point in the history
  • Loading branch information
magomimmo committed Dec 5, 2012
1 parent 621eb72 commit fa1ac41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion compiler/clojurescript
Submodule clojurescript updated from b6e6bb to fb58dd
14 changes: 7 additions & 7 deletions doc/tutorial-10.md
Expand Up @@ -118,16 +118,16 @@ names speck for themself.

```clojure
(defn create-context []
(doall (map #(.mkdir (io/file %)) @dir-names))
(doall (map #(.createNewFile (io/file %)) @file-names)))
(doall (map #(.mkdir (io/file %)) dir-names))
(doall (map #(.createNewFile (io/file %)) file-names)))

(defn clear-context []
(doall (map #(.delete (io/file %)) @file-names))
(doall (map #(.delete (io/file %)) (reverse @dir-names))))
(doall (map #(.delete (io/file %)) file-names))
(doall (map #(.delete (io/file %)) (reverse dir-names))))
```

We used `doall` to force the realization of each element of the involved
sequences (i.e. `@dir-names` and `@file-names`).
sequences (i.e. `dir-names` and `file-names`).

### Respect for the new not so more mutable world

Expand Down Expand Up @@ -216,10 +216,10 @@ functions to dinamically calculate the expected results for each call execution
Here is the interested code snippet.

```clojure
(def files (map #(io/file %) @file-names))
(def files (map #(io/file %) file-names))

(def file-paths (map #(str (.getCanonicalPath ^java.io.File (io/file ".")) java.io.File/separator %)
@file-names))
file-names))

(defn get-file-names [coll indeces]
(map #(nth coll %) indeces))
Expand Down

0 comments on commit fa1ac41

Please sign in to comment.