Quote:
Originally Posted by MeteorRain
I'd like to re-raise the problem -- array idea seems to be incompatible with previous versions.
|
Good question, sorry, I have read it but could not deal with it because this topic needed a whole attention which I did not have.
I was looking for a way to keep existing 'type' and '+' format, but I could not find a convenient and compatible way to do that.
At the moment "a" type in function signatures are for ".+" and requires [] syntax on the script side. Nor can it specifiy that you want a float-only array for example. On the bright side, new-style dedicated array parameters can appear anywhere in the list and can have names, can follow each other even with specifying zero elements in them.
Another big difference that new-style script arrays can be of multiple levels, not only an 1-D array, like they are treated in parameter list (btw - you are dealing with dual AVS-VS interfaces, does VapourSynth allows multilevel array as function parameters?). They can be of 0 or 1 elements and they still preserve their type as array.
There are more differences: unlike old arrays they are deep-copied and deep-deleted on deallocation (except on C interface which is treated specially)
I think I have to look at that in internal "Invoke_" as well. In "Invoke_" the array-typed arguments are totally 'flattened' back before calling function-match checking (thus their arrayness is removed). This is a reason why array arguments cannot follow each other as an unnamed parameters. The array parameters (if they are of mixed type or zero sized) cannot be separated again any more.