Skip to content

Commit 2cfd023

Browse files
committed
Add doco block in README for lazy evaluation feature
1 parent 4d02597 commit 2cfd023

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,19 @@ braces:
14901490
echo 'I {{ "{{" }}LOVE}} curly braces!'
14911491
```
14921492

1493+
#### Lazy Evaluation
1494+
1495+
By default, variables are evaluated when they are defined. If you would like a
1496+
variable to only be evaluated when it is used for the first time, you can use the
1497+
`lazy` keyword:
1498+
1499+
```just
1500+
lazy password := `aws ecr get-login-password --region us-west-2`
1501+
```
1502+
1503+
This is useful for values that are expensive to compute, or that may not be
1504+
needed in every invocation of `just`.
1505+
14931506
### Strings
14941507

14951508
`'single'`, `"double"`, and `'''triple'''` quoted string literals are

0 commit comments

Comments
 (0)