You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -328,9 +328,10 @@ Each list item can contain any PDL block (strings are shown here), and the resul
328
328
Notice that block types that require lists (`repeat`, `for`, `if-then-else`) have the `lastOf` semantics by default. For more detailed discussion
329
329
on this see [this section](#conditionals-and-loops).
330
330
331
-
The PDL interpreter will raise a warning for a list item inside a `lastOf` block that is not capturing the result in a variable definition, or contributing
332
-
the result, meaning that the result is being ignored.
333
-
If this is intended, the warning can be turned off by including `contribute: []` or `contribute: [context]` for that block.
331
+
The PDL interpreter will raise a warning for a list item inside a `lastOf` block that is not capturing the result in a variable definition meaning that the result is being implicitly ignored.
332
+
If this is intended because the block is contributing to the context or doing a side effect for example, the warning can be turned off by including `contribute: [context]` or `contribute: []`.
333
+
On the other hand, if this was a mistake, then capture the result of the block using a variable definition by adding `def`.
334
+
You could also turn the list into a text or an array by surrounding it with a `text` or `array` block so that no result is lost.
0 commit comments