anchor.diff:  ----
   
   [[anon_vector]]
  -**Why doesn't the anonymous function `#([%1])` work to construct a vector?**
  +**<<faq#anon_vector,Why doesn't the anonymous function `#([%1])` work to construct a vector?>>**
   
   `++#()++` always expands to include parens around the expression you give it, thus in this case it yields `(fn [x] ([x]))` which fails when the vector is invoked. Instead, use the vector function `++#(vector %)++` or just `vector`, which is the function being described.
   
   == Collections, Sequences, and Transducers
   
   [[conj]]
  -**Why does `conj` add to the front of a list and the back of a vector?**
  +**<<faq#conj,Why does `conj` add to the front of a list and the back of a vector?>>**
   
   Most Clojure data structure operations, including `conj` (conjoin), are designed to give the user a performance expectation. With `conj`, the expectation is that insertion should happen at the place where this operation is efficient. Lists (as linked lists) can make a constant time insertion only at the front. Vectors (indexed) are designed to expand at the back. As the user, you should consider this when you choose which data structure to use. In Clojure, vectors are used with much greater frequency.
   
   [[seqs_vs_colls]]
  -**I keep forgetting that after calling sequence functions on vectors/sets, the return value is no longer a vector or a set.**
  +**<<faq#seqs_vs_colls,I keep forgetting that after calling sequence functions on vectors/sets, the return value is no longer a vector or a set.>>**
   
   Generally you should divide the Clojure core functions into these two categories:
   
  
positive.code: == Design and Use
  
  [[encapsulation]]
  **How do you achieve encapsulation with Clojure?**
  
  Because of its focus on immutable data, there is generally not a high value placed on data encapsulation. Because data is immutable, there is no worry about someone else modifying a value. Likewise, because Clojure data is designed to be manipulated directly, there is significant value in providing direct access to data, rather than wrapping it in APIs.
  
  
negative.code: == State and Concurrency
  
  [[concurrency_features]]
  **<<faq#concurrency_features,What are the trade-offs between reducers, core.async, futures, and pmap?>>**
  
  Each of these really addresses a different use case.
  
  - Reducers are best for fine-grained data parallelism when computing a transformation over existing in-memory data (in a map or vector). Generally it's best when you have thousands of small data items to compute over and many cores to do the work. Anything described as "embarrassingly parallel".
  - futures are best for pushing work onto a background thread and picking it up later (or for doing I/O waits in parallel). It's better for big chunky tasks (go fetch a bunch of data in the background).
  - core.async is primarily used to organize the subsystems or internal structure of your application. It has channels (queues) to convey values from one "subprocess" (go block) to another. So you're really getting concurrency and architectural benefits in how you break up your program. The killer feature you can really only get in core.async is the ability to wait on I/O events from multiple channels for the first response on any of them (via alt/alts). Promises can also be used to convey single values between independent threads/subprocesses but they are single delivery only.
  - tools like pmap, java.util queues and executors, and libraries like claypoole are doing coarse-level "task" concurrency. There is some overlap with core.async here which has a very useful transducer-friendly pipeline functionality.
  
  [[write_skew]]
  **<<faq#write_skew,Why does the Clojure STM does not guarantee serializability but only snapshot isolation?>>**
  
  If reads were included by default, then STM would be slower (as more transactions would require serializability). However, in many cases, reads do not need to be included. Thus, users can choose to accept the performance penalty when it is necessary and get faster performance when it is not.
  
  == Namespaces
  
  [[ns_file]]
  **<<faq#ns_file,Do namespaces map 1-to-1 with files?>>**
  
  No (although that is typical). One namespace can be split across multiple files by using `load` to load secondary files and `in-ns` in those files to retain the namespace (clojure.core is defined in this way). Also, it is possible to declare multiple namespaces in a single file (although this is very unusual).
  
  [[ns_as_fn]]
  **<<faq#ns_as_fn,Do namespaces work like regular functions? Looking at the syntax, it seems ns could be returning a function that makes a namespace, and then if you just stick parens around the contents of the file, that would be a regular S expression too. Does that imply you can put more than one in a file?>>**
  
  ns is a macro that does a number of things:
  
  