Skip to content

Commit 989176c

Browse files
committed
Rename sequence into lastof
1 parent be5ca8c commit 989176c

10 files changed

+2293
-2293
lines changed

docs/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ The next block is an if-then-else. We check if `REASON_OR_CALC` ends with `<<` a
567567

568568
When we execute this program, we obtain 3 math problems like the ones in the [examples](https://github.com/IBM/prompt-declaration-language//blob/main/examples/arith/).
569569

570-
Notice that the `repeat` and `then` blocks are followed by `document`. This is because of the semantics of lists in PDL. If we want to aggregate the result by stringifying every element in the list and collating them together (which is the case of top-level programs in general), then we need the keyword `document` to preceed a list. If this is omitted then the list is treated as a programmatic sequence where all the blocks are executed in sequence but result of the overall list is the result of the {\em last} block in the sequence.
570+
Notice that the `repeat` and `then` blocks are followed by `document`. This is because of the semantics of lists in PDL. If we want to aggregate the result by stringifying every element in the list and collating them together (which is the case of top-level programs in general), then we need the keyword `document` to preceed a list. If this is omitted then the list is treated as a programmatic sequence where all the blocks are executed in sequence but result of the overall list is the result of the {\em last} block in the sequence. This behavior can be marked explicitly with a `lastof` block.
571571

572572
Similarly, the `read` block has an annotation `as: document`. This means that the result of each iteration is stringified and collated to the overall result of the `repeat` block which is of type string in this case.
573573

0 commit comments

Comments
 (0)