Skip to content

Commit 1e33866

Browse files
committed
content/howto: mention self as a list reference
This adds an example of the aliasv2 experiment's self identifier being used to reference a containing list. Preview-Path: /docs/howto/try-aliasv2-experiment/ Signed-off-by: Jonathan Matthews <[email protected]> Change-Id: I51c88a0d9a3f30c087bacb47749cb6d1db788281 Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cuelang.org/+/1225870 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Roger Peppe <[email protected]>
1 parent 0d54a17 commit 1e33866

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

content/docs/howto/try-aliasv2-experiment/en.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ e: {
177177
g: Root["-foo"] + 2
178178
"-foo": "not-44"
179179
}
180+
181+
// The self identifier references containing lists.
182+
h: [10, self[0] + 1, self[1] * 2]
180183
-- out --
181184
a:
182185
foo:
@@ -188,6 +191,10 @@ d: 45
188191
e:
189192
g: 46
190193
-foo: not-44
194+
h:
195+
- 10
196+
- 11
197+
- 22
191198
{{{end}}}
192199

193200
## Conclusion

content/docs/howto/try-aliasv2-experiment/gen_cache.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ package site
1111
"1 new": "nxPfn5SpmUHekMpOyGDGcOnXNm3psvRuKQZjFTWcwtU="
1212
}
1313
code: {
14-
"2 new": "49o/cDoGgckZtwb5VXVZHrkzxKJn/Pjg/2KeyJYQYEs="
14+
"2 new": "LLv5ph8BPtnBPvtWk+P+21yRQYaRYuV1zAWzj6I9v5w="
1515
}
1616
multi_step: {
1717
hash: "NGD7JD5BHLDTV27R09JF6B7G7O0UC6T09J9C1TMC6C84DK2FTETG===="

hugo/content/en/docs/howto/try-aliasv2-experiment/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ e: {
190190
g: Root["-foo"] + 2
191191
"-foo": "not-44"
192192
}
193+
194+
// The self identifier references containing lists.
195+
h: [10, self[0] + 1, self[1] * 2]
193196
{{< /code-tab >}}
194197
{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCBleHBlcmltZW50YWwtc3ludGF4LmN1ZSAtLW91dCB5YW1s" >}}
195198
$ cue export experimental-syntax.cue --out yaml
@@ -203,6 +206,10 @@ d: 45
203206
e:
204207
g: 46
205208
-foo: not-44
209+
h:
210+
- 10
211+
- 11
212+
- 22
206213
{{< /code-tab >}}
207214
{{< /code-tabs >}}
208215

0 commit comments

Comments
 (0)