From 63b48552b1b96fc8b6895545ecef70bd1195872b Mon Sep 17 00:00:00 2001 From: srush Date: Thu, 14 Jan 2021 15:33:24 -0500 Subject: [PATCH] Adam comment --- examples/tutorial.dx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/tutorial.dx b/examples/tutorial.dx index c6befea90..03894c331 100644 --- a/examples/tutorial.dx +++ b/examples/tutorial.dx @@ -88,7 +88,8 @@ include "plot.dx" ' `y = [1.0 for j in range(width) for i in range(height)]` ' The analogous table construct in Dex is written in the following form. It - produces a one-dimensional table of `Height x Width` elements. + produces a one-dimensional table of `Height x Width` elements. Here `&` + indicates a tuple constructor. y = for (i, j) : (Height & Width) . 1.0 @@ -140,6 +141,7 @@ row = x.(3 @ Height) ' Another consequence is that you cannot use indices as integers. It is necessary to explicitly annotate index types with `ordinal`. + This is because finite sets i.e. `Fin` are not closed under addition. :t for i:Height. for j:Width. i + j