View Full Version : Name resolution ambiguity


flossy_cake
14th June 2026, 12:43
global bwdif = BWDIF()


I know you're not supposed to do this because the parser finds it ambiguous whether bwdif points to the global clip or the function.

But in practice I've not had any issues because everything downstream from the above code always references the global clip.

And I know this because if I put


global bwdif = BWDIF().Text("yep definitely the global clip")


It always shows the text when I reference bwdif downstream, even when it's highly convoluted and inside a ScriptClip.

I've asked AI about it extensively but can't get a definitive answer, was hoping someone with more knowledge could comment.

Did this name resolution ambiguity get patched in Avisynth+ at some point in development? Because I could see how adding the brackets at the end of BWDIF() could inform the parser it's a function rather than a variable.

:thanks:

hello_hello
16th June 2026, 15:02
Maybe it's because I'm an idiot, but I can't help wonder why you wouldn't use an unambiguous variable name in the first place.

global bwdif_clip = BWDIF()

flossy_cake
24th June 2026, 13:40
Maybe it's because I'm an idiot, but I can't help wonder why you wouldn't use an unambiguous variable name in the first place.

global bwdif_clip = BWDIF()


It's too late, I already wrote 10,000 lines of code with references to it everywhere across multiple files :o

I could do a "find and replace" in notepad++ but I don't trust it not to make bugs in my script.

I was thinking of writing my own auto hotkey script to do the "find all" and generate a dictionary of all my globals and then do preview of every instance so I can visually glance through it for trustworthiness before committing the changes.