glox/tests/functions.lox

26 lines
328 B
Text
Raw Normal View History

2024-10-09 19:57:52 +03:00
2024-10-09 23:36:18 +03:00
print "native function";
2024-10-09 19:57:52 +03:00
2024-10-09 23:36:18 +03:00
print clock();
fun count(n) {
if (n > 1) count(n - 1);
print n;
}
count(10);
fun hi(name, surname) {
print "hello, " + name + " " + surname + "!";
}
hi("John", "Doe");
fun re(turn) {
print "before retrun";
return turn;
print "should not be printed";
}
print re("print");