Chapter 1. Why Nim?
Listing 1.1. Style insensitivity
Listing 1.2. Style insensitivity and type identifiers
Listing 1.3. Iterating from 0 to 9 in Nim
Listing 1.4. Iterating from 0 to 9 in C++
Listing 1.5. Barking dog modeled using OOP in Python
Listing 1.6. Barking dog modeled using procedural programming in Nim
Listing 1.7. Iterating over a sequence using functional programming in Nim
Listing 1.8. Iterating over a sequence using a procedural style in Nim
Chapter 2. Getting started
Listing 2.1. C
Listing 2.2. Ruby
Listing 2.3. Nim
Listing 2.4. Integer literals
Listing 2.5. Float literals
Listing 2.6. Boolean literals
Listing 2.7. Character literals
Listing 2.8. Constant example
Listing 2.9. Using anonymous procedures
Listing 2.10. Raising an exception
Listing 2.11. The try statements
Listing 2.12. Handling an exception using a try statement
Listing 2.13. Mutable and immutable parameters
Listing 2.14. Enumerator type
Chapter 3. Writing a chat application
Listing 3.1. Conversation between me, John, and Grace about Game of Thrones
Listing 3.2. Typical directory layout for a Nim project
Listing 3.3. Reading command-line parameters
Listing 3.4. Reading from the standard input stream
Listing 3.5. Spawning readLine in a new thread
Listing 3.6. Message type definition and proc stub
Listing 3.7. A representation of a message in JSON
Listing 3.8. Parsing JSON in protocol.nim
Listing 3.9. The mapping between JSON values and the JsonNodeKind type
Listing 3.10. Assigning parsed data to the result variable