From fa92a157746ae17f295d31b7a047dfeb99624a13 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Wed, 11 Jun 2025 00:16:17 +0200 Subject: Misc: Rename lang --- examples/5.pry | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 examples/5.pry (limited to 'examples/5.pry') diff --git a/examples/5.pry b/examples/5.pry new file mode 100644 index 0000000..f12fbae --- /dev/null +++ b/examples/5.pry @@ -0,0 +1,31 @@ +/* As you see, the language supports variable scopes */ + +import "!stdlib.pry"; + +let x = 18; + +let foo = () => i64 { + let x = 1; + printf("%d\n", x); + return x; +}; + +let main = () => i64 { + printf("%d\n", x); + let x = 2; + let y = foo(); + printf("%d\n", x); + return x + y; +}; + +/* + +Expected stdout: + +18 +1 +2 + +Expected return: 3 + +*/ -- cgit 1.4.1