Skip to content

Commit b04919e

Browse files
authored
Merge pull request #48 from mkantor/readme-updates
Improve README section on object syntax
2 parents 3ec70ca + 1e51f89 commit b04919e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,22 @@ Objects are maps of key/value pairs ("properties"), where keys must be atoms:
7070
{ greeting: "Hello, World!" }
7171
```
7272

73-
Object properties without explicitly-written keys are automatically enumerated:
73+
Properties are delimited by whitespace and/or commas:
7474

7575
```
76-
{ Hello World } // is the same as { 0: Hello, 1: World }
76+
// These all mean the same thing:
77+
{
78+
a: 1
79+
b: 2
80+
}
81+
{ a: 1, b: 2 }
82+
{ a: 1 b: 2 }
83+
```
84+
85+
Properties without explicitly-written keys are automatically enumerated:
86+
87+
```
88+
{ a b } // is the same as { 0: a, 1: b }
7789
```
7890

7991
#### Lookups
@@ -153,7 +165,7 @@ keyword expressions.
153165
Under the hood, keyword expressions are modeled as objects. For example, `:foo`
154166
desugars to `{@lookup key: foo}`. All such expressions have a key `0` referring
155167
to a value that is an `@`-prefixed atom (the keyword). Keywords include
156-
`@function`, `@lookup`, `@apply`, `@check`, `@index`, `@if`, `@panic`, and
168+
`@apply`, `@check`, `@function`, `@if`, `@index`, `@lookup`, `@panic`, and
157169
`@runtime`.
158170

159171
Currently only `@function`, `@lookup`, `@index`, and `@apply` have syntax

0 commit comments

Comments
 (0)