Skip to content

Commit 047d186

Browse files
committed
Update examples in README
1 parent 2578fc8 commit 047d186

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ expressions_. Most of the interesting stuff that Please does involves evaluating
151151
keyword expressions.
152152

153153
Under the hood, keyword expressions are modeled as objects. For example, `:foo`
154-
desugars to `{@lookup query: foo}`. All such expressions have a key `0`
155-
referring to a value that is an `@`-prefixed atom (the keyword). Keywords
156-
include `@function`, `@lookup`, `@apply`, `@check`, `@index`, and `@runtime`.
154+
desugars to `{@lookup key: foo}`. All such expressions have a key `0` referring
155+
to a value that is an `@`-prefixed atom (the keyword). Keywords include
156+
`@function`, `@lookup`, `@apply`, `@check`, `@index`, and `@runtime`.
157157

158158
Currently only `@function`, `@lookup`, and `@apply` have syntax sugars.
159159

@@ -233,14 +233,20 @@ It desugars to the following `plo` program:
233233
function: {
234234
0: @apply
235235
function: {
236-
0: @lookup
237-
query: atom.prepend
236+
0: @index
237+
object: {
238+
0: @lookup
239+
key: atom
240+
}
241+
query: {
242+
0: prepend
243+
}
238244
}
239245
argument: "Welcome to "
240246
}
241247
argument: {
242248
0: @lookup
243-
query: language
249+
key: language
244250
}
245251
}
246252
now: {
@@ -249,8 +255,15 @@ It desugars to the following `plo` program:
249255
0: @function
250256
parameter: context
251257
body: {
252-
0: @lookup
253-
query: context.program.start_time
258+
0: @index
259+
object: {
260+
0: @lookup
261+
key: context
262+
}
263+
query: {
264+
0: program
265+
1: start_time
266+
}
254267
}
255268
}
256269
}
@@ -269,8 +282,15 @@ Which in turn compiles to the following `plt` program:
269282
0: @function
270283
parameter: context
271284
body: {
272-
0: @lookup
273-
query: context.program.start_time
285+
0: @index
286+
object: {
287+
0: @lookup
288+
key: context
289+
}
290+
query: {
291+
0: program
292+
1: start_time
293+
}
274294
}
275295
}
276296
}
@@ -283,7 +303,7 @@ Which produces the following runtime output:
283303
{
284304
language: Please
285305
message: "Welcome to Please"
286-
now: "2025-01-27T16:06:55.802Z"
306+
now: "2025-02-14T18:45:14.168Z"
287307
}
288308
```
289309

0 commit comments

Comments
 (0)