]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / LocalDefinitions.scl
1
2 data List a = Nil | Cons a (List a)
3
4 reverse :: List a -> List a
5 reverse l = do 
6     reverseAux accum Nil        = accum
7     reverseAux accum (Cons h t) = reverseAux (Cons h accum) t
8     reverseAux Nil l
9     
10 main = reverse (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) (Cons (4 :: Integer) Nil))))
11 --
12 (Cons 4 (Cons 3 (Cons 2 (Cons 1 Nil))))