Skip to content

Commit

Permalink
Adam comment
Browse files Browse the repository at this point in the history
  • Loading branch information
srush committed Jan 14, 2021
1 parent c0ba516 commit 63b4855
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/tutorial.dx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 63b4855

Please sign in to comment.