Im aware of that one SamuraiCrow. While that one gives possibility to have changing amount of variables, it doesnt give possibility to sometimes leave some arg from middle out.
To illustrate better what I am after and wanting:
Code: Select all
function MyFunc(varA, barB, varC) endfunction
Using instead:
I can have:
varA only, or varA and varB only, or varA, varB and varC all.
But what i cant have is to have varA and varC only, for:
Code: Select all
myfunc(sendingtovarA, sendingtovarC)
Now how does the function know that I am sending to varC instead of varB? It doesnt.
Basically what could be solution, but I dont think Hollywood has support for it, not sure if any programming language has, but basically i guess it would be doable that Hollywood would recognise what type of information I am sending to that function.
That say i have table Cat and Table Dog, which are different enough that you can make distinction between them, say:
Code: Select all
dog = { walk = walkfunc, sniff = snifffunc, wof = woffunc }
cat = { walk = walkfunc, meow = meowfunc, 9lives = true }
I guess in theory these two tables could be distingishable from each other since they have different subtables in them. Therefore there could be function:
Code: Select all
function myfunc(cat, dog) endfunction
and then if i would send only dog sometime:
it could notice that the variable (table) that is coming now is not of a type cat but of a type dog and therefore send the sent variabletable to the cat variable.
But I guess this is not really doable in Hollywood (if even elsewhere), or is it?