PDA

View Full Version : Implicit last


WarpEnterprises
24th September 2003, 12:14
If arguments are passed as array (AVSValue args) and then referenced with args[0],...
is implicit "last" inserted as args[0]?
Or does this depend on how the Filter is actually called:

Filter()
or
Filter(last)
or
Filter #without brackets

It seems that this may be related to

https://sourceforge.net/tracker/index.php?func=detail&aid=811666&group_id=57023&atid=482673

sh0dan
24th September 2003, 17:08
Basicly it works like this:

Avisynth attempts to call the function with explicit last. If a function with these parameters cannot be found, it inserts implicit last as the first argument, and calls the function with these parameters.

WarpEnterprises
24th September 2003, 17:38
But why then is there a difference between

Filter()

and

Filter

Shouldn't it both do the same?
- this reminds me on the "missing ()" vs. speed rumour...

[edit] or maybe it assumes OOP notation
last.Filter()
which works, too

neuron2
24th September 2003, 18:24
It was not just a rumour! I don't know about the current versions of Avisynth, though.

sh0dan
24th September 2003, 22:20
If no "(" is found, the name is assumed to be a variable. If there is no variable, or it somehow fails, AviSynth attempts to call it as a function.

Regarding the performance using "()": It could seem that there is no cache assigned, if "()" is not used.