I think that function calling without parentheses is a bad idea.
Well, worked in Basic, too. But I agree, it could be misleading/harder to read and you don't gain anything making the parenthesis optional, so I'd just force them, especially when supporting some kind of pointers or references (to distinct between wanting the address or return value for example). Otherwise things like "x = functionname" will be misleading, especially for beginners, cause most would expect the return value to be assigned.
As far as I know, parentheses in function calls in Ruby aren't needed, either, am I right?
Most of you are just too used to C style languages, where parentheses around function parameters are needed. Maybe I will get another idea for function calls, because... those parentheses are also used in simple expressions to group certain operations together...
There is one simple rule to remember my syntax: when not expecting some function return value by a function call, the parentheses are not needed. If you are unsure whether you should put parentheses or not, to call a function, you can
always put them, especially, if you are used to C style languages.
There are some other language aspects, I would like to discuss more. In SilverScript, a
Class is the same as an
Object,
Namespace or
Structure. An object is just a
copy of a class (function code internally keeps referenced) and could be used a sub class which could also be instanciated (so, copied). The usual way to implement a class is the following:
class foobar
# attributes
x = 0
y = 0
# methods
function do_something
# function code...
end
end
instance = foobar.new()
instance.do_something()
...
I call this type of class implementation
explicit implementation/conversion/casting. As types are dynamic in SilverScript, the following (for example for a vector structure) could also work:
# 'pos' is not set, it is nil
# by accessing any attribute of pos, it is automatically converted to an empty class
# I call this 'implicit implementation' or '- conversion' or '- casting'
pos.x = 0
pos.y = 0
In Lua you always have to "declare" a table like
pos = {} before you can set any attributes.
The same rule applies for arrays: when accessing/setting an index with the []-operator, the variable is internally converted to an array, and any previous data (e.g. class attributes) is deleted.