Skip to content
Open

Typo #17

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manuscript/markdown/mainmatter/1.objects/2.pojos.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The prime purpose of a namespace is to provide disambiguation for a set of relat

### pojos as data structures

Namespaces are typically created statically and named. But objects need not by named, and they need not be static. Dictionaries can be used when we need a dynamic data structure that has arbitrary key-value pairs added and removed, and they can also be used to implement data structures (or parts of data structures) with named components.
Namespaces are typically created statically and named. But objects need not be named, and they need not be static. Dictionaries can be used when we need a dynamic data structure that has arbitrary key-value pairs added and removed, and they can also be used to implement data structures (or parts of data structures) with named components.

Here're some functions that operate on a dictionary:

Expand Down Expand Up @@ -92,4 +92,4 @@ function cons (value, list) {

We're using a dictionary as an implementation technique, but we are really writing functions that operate on a tuple with elements named `_a` and `_d`. A lot of "objects" in JavaScript are data structures with named elements. They happened to be implemented with objects that act as dictionaries, but they aren't intended to be used as arbitrary key-value stores.

K> JavaScript objects are dictionaries. Dictionaries can be used to make data structures: The distinction is in how there are intended to be used. If an object is a container for arbitrary key-value pairs, it is a dictionary. If an object is a container for specific, named values, it's a custom data structure that is implemented with a dictionary.
K> JavaScript objects are dictionaries. Dictionaries can be used to make data structures: The distinction is in how there are intended to be used. If an object is a container for arbitrary key-value pairs, it is a dictionary. If an object is a container for specific, named values, it's a custom data structure that is implemented with a dictionary.