mirror of
https://github.com/apple/pkl.git
synced 2026-07-10 07:02:50 +02:00
Update docs/modules/language-tutorial/pages/02_filling_out_a_template.adoc
Co-authored-by: Philip K.F. Hölzenspies <holzensp@gmail.com>
This commit is contained in:
committed by
Philip K.F. Hölzenspies
parent
0b680be32b
commit
1a1d2f9908
@@ -381,7 +381,7 @@ pipelines {
|
|||||||
<1> There is no pipeline object to amend. The `new` keyword gives you an object to amend.
|
<1> There is no pipeline object to amend. The `new` keyword gives you an object to amend.
|
||||||
|
|
||||||
So far, you've defined objects the same way you amended them.
|
So far, you've defined objects the same way you amended them.
|
||||||
When the `name` didn't occur before, `new { ... }` _creates_ a property called `name` and assigns to it the object specified on the `Listing`.
|
If the name `foo` didn't occur before, `foo { ... }` _creates_ a property called `foo` and assigns to it the contents in place of the `...` (given that `...` is not valid Pkl, but an abbreviation for illustration purposes).
|
||||||
If `name` is an existing object, this notation is an _amend expression_; resulting in a new _object_ (value), but _not_ a new (named) property.
|
If `name` is an existing object, this notation is an _amend expression_; resulting in a new _object_ (value), but _not_ a new (named) property.
|
||||||
Since `pipelines` is a listing, you can _add_ elements by writing expressions in an amend expression.
|
Since `pipelines` is a listing, you can _add_ elements by writing expressions in an amend expression.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user