aboutsummaryrefslogtreecommitdiff
path: root/test/minmax.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-04-12 13:09:31 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-04-12 13:09:31 -0400
commit6c01eef851439549018267fdc439e4884af0c624 (patch)
tree0599dd071b8a5effb67e6a87ed1c34777eb8d8c7 /test/minmax.tm
parent17cb6ffd88c4464c513b045f4b06c4e6e46e8f22 (diff)
Introducing the main() function
Diffstat (limited to 'test/minmax.tm')
-rw-r--r--test/minmax.tm33
1 files changed, 17 insertions, 16 deletions
diff --git a/test/minmax.tm b/test/minmax.tm
index 58d9661d..c3af68d6 100644
--- a/test/minmax.tm
+++ b/test/minmax.tm
@@ -1,26 +1,27 @@
->> 3 _min_ 5
-= 3
->> 5 _min_ 3
-= 3
-
struct Foo(x:Int, y:Int)
func len(f:Foo)->Num
return Num.sqrt(f.x*f.x + f.y*f.y)
->> Foo(5, 1) _min_ Foo(5, 999)
-= Foo(x=5, y=1)
+func main()
+ >> 3 _min_ 5
+ = 3
+ >> 5 _min_ 3
+ = 3
+
+ >> Foo(5, 1) _min_ Foo(5, 999)
+ = Foo(x=5, y=1)
->> Foo(5, 999) _min_.x Foo(5, 1)
-= Foo(x=5, y=999)
+ >> Foo(5, 999) _min_.x Foo(5, 1)
+ = Foo(x=5, y=999)
->> Foo(999, 1) _min_.y Foo(1, 10)
-= Foo(x=999, y=1)
+ >> Foo(999, 1) _min_.y Foo(1, 10)
+ = Foo(x=999, y=1)
->> Foo(-999, -999) _max_:len() Foo(10, 10)
-= Foo(x=-999, y=-999)
+ >> Foo(-999, -999) _max_:len() Foo(10, 10)
+ = Foo(x=-999, y=-999)
->> foos := [Foo(5, 1), Foo(5, 99), Foo(-999, -999)]
->> (_max_) foos
-= Foo(x=5, y=99)
+ >> foos := [Foo(5, 1), Foo(5, 99), Foo(-999, -999)]
+ >> (_max_) foos
+ = Foo(x=5, y=99)