From 1058cefc7a393b318849b1d4d8b34cc9a9af7147 Mon Sep 17 00:00:00 2001 From: hanez Date: Fri, 19 Sep 2025 10:32:24 +0200 Subject: [PATCH] Just playing and having fun... --- play.fun | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/play.fun b/play.fun index 49165d2..379a562 100755 --- a/play.fun +++ b/play.fun @@ -15,16 +15,51 @@ fun foo() print("Yay, the playground for having fun... ;)") -number n = 10 +number n = 23 print(n) -n = "foobar" +// This must fail because n is of type number and can not become a string or function. Setting it to 0 is not an option. +n = "FooBar" print(n) n = 100 print(n) +print("Typeof n: " + typeof(n)) + +fun n() + print("n") +n() +// Typeof n must be of type function here... Not Sint64. +print("Typeof n: " + typeof(n)) + +n = 2342 +print(n) +print("Typeof n: " + typeof(n)) + +x = 42 +print (x) + +x = "BarFoo" +print(x) + +// Arrays must be declared with an "array" identifier if not beeing dynamicly typed. We need the "array" type." +a = [23, 42] +print(a) +print(a[0]) + +// Why this is possible? Seting n to a string, sets n to 0. Setting an array to 1 works...? This must fail when an a is of type "array", not in this case! +a = 1 +print(a) string s = 'Have\n"fun!"' print(s) +print("\'" + " Fun") +print('\'' + " \'Fun\'") +print('\'' + " \"Fun\"") +print('\'' + " \n\"Fun\"") +print('\'' + " \n\t\"Fun\"") + +print("Running foo()...") + foo()