View Single Post
Old 21st June 2008, 20:45   #18  |  Link
gzarkadas
Registered User
 
gzarkadas's Avatar
 
Join Date: Sep 2005
Location: 100011110010001000001 10000011111111000001
Posts: 221
If performance is not an issue, as IanB correctly states (just finished testing it) then moving current_frame to global var space is something that can be afforded. The only thing that will break is scripts that explicitly assign current_frame, but these are very rare and easy to fix.

The way that Avisynth currently implements its vartables does not provide any advantage on having current_frame in a local vartable, because it always lives at the script-level local vartable, which never dies, thus effectively having all disadvantages that a global variable has, plus the disadvantage that it is not a trully global variable.

In fact, now that I am thinking of it I wonder whether it would worth the effort to make the global vartable being just an alias (for not breaking existing code) of the script-level local vartable and get rid of the global keyword in exchange for a new can of worms .
__________________
AVSLib, a free extension library for Avisynth. Current version: 1.1.0 (beta), 14/05/2007.
[ Home page | Download page ]
gzarkadas is offline   Reply With Quote