Thanks for the feedback 
Regarding 'right', I designed it to function like that already in the first version of naalaa. 'right' returns the opposite part of a string compared to 'left', because whenever I (myself) use 'right' it's in some sort of combination with 'left'.
The problem with the other errors is that n7 doesn't do ANY type checking at compile time (much like Lua), because variables are allowed to change type at runtime. And, yes, that is kind of bad in the cases where the errors are "obvious". I should try to detect these cases and atleast output warnings.
If you look at the above code, you might see the beginning of how complicated these checks could become. And that's pretty much why I never bothered to make any checks at all.
In your examples, the compiler just assumes that the variables hold functions and that you're trying to call them. "(renv) bugs.n7:24: runtime error: Register is not a label (BC_CALL_R)" Haha, and that is what you get when you try to make a function call through a variable that isn't a function. I should definitely change that runtime error message, sorry

Regarding 'right', I designed it to function like that already in the first version of naalaa. 'right' returns the opposite part of a string compared to 'left', because whenever I (myself) use 'right' it's in some sort of combination with 'left'.
The problem with the other errors is that n7 doesn't do ANY type checking at compile time (much like Lua), because variables are allowed to change type at runtime. And, yes, that is kind of bad in the cases where the errors are "obvious". I should try to detect these cases and atleast output warnings.
Code:
visible foo = [1, 2, 3, 4, 5]
bar()
pln foo(4)
function bar()
if rnd(2) = 0
foo = function(x)
return x^2
endfunc
else
foo = baz
endif
endfunc
function baz(x)
return |x|
endfunc
If you look at the above code, you might see the beginning of how complicated these checks could become. And that's pretty much why I never bothered to make any checks at all.
In your examples, the compiler just assumes that the variables hold functions and that you're trying to call them. "(renv) bugs.n7:24: runtime error: Register is not a label (BC_CALL_R)" Haha, and that is what you get when you try to make a function call through a variable that isn't a function. I should definitely change that runtime error message, sorry
