]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/ListSyntax10.scl
Re-enabled Acorn transaction cancellation support for testing
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / ListSyntax10.scl
1 import "Prelude"\r
2 \r
3 dists l = sum [sqrt (dx*dx + dy*dy) \r
4               | i <- [0..length l-2]\r
5               , (x1,y1) = l!i\r
6               , (x2,y2) = l!(i+1)\r
7               , dx = x1-x2\r
8               , dy = y1-y2 ]\r
9               \r
10 main = dists [(0,0),(1,1),(2,0)]\r
11 --            \r
12 2.8284271247461903