params
having a parameter params
means unlimited argument e.gtestBlock(1)
testBlock("a string")
tesBlock([1,2],"desperado","inverse",45,87,97,new Directory("../"), [9,3,3])
block testBlock(params)
@leghtOf(params)
testBlock("Hello", "World", 40)
block testBlock(params)
@params[0] #Hello
@params[1] #World
@params[2] #40
...
will take more scanning time as it will be added to keyword.
...
and give you guyz feedback
Hello guyz. Implementing the ...
i hit a wall the ...
is only usable in language that has type specifier e.g String str = ""
but in simple lang it str = ""
so the ...
is not possible e.g in a block we have
block test(p1,p2,p3)
Using ...
as variadic parameter
test(1,2,4,5)
block test(p1,p2,...)
@...[0] #a big lang breaking error
or we go with C Style that will just bring a foreign identifier to fix that
test(1,2,4,5)
block test(p1,p2,...)
@var_args[0]
Using the ...
is only acceptable for strongly types language e.g java
public void functionOne(String... strings)
System.out.println(strings[0])
...
is still not possible e.g this is valid in simple-langblock test(String params)
@params
I don't think ...
is meant to be used as an identifier. It's more like a modifier.
So instead of the one you have above, its should actually be like this.
test(1, 2, 3, 4)
block test(p1, p2, p3...)
return p3[0]
When types come, then it will look sth like this
test(1, 2, "Hello")
block test(Number p1, Number p2, String p3...)
return p3[0]
go get ...
e.g $ modular install Youngestdev/NgBanks
__OBJECT
style.