Page 2 of 2

Re: blanks in ternary operator

Posted: 24 Jan 2018, 16:53
by jeeswg
- @coffee: Re. "". It's an important script error/conversion detail to know about. FWIW I did think up some of your for/against points, but my statement was neutral.

- This thread has a become a good collection of information re. omitted parameters. In that vein:
Object declaration syntax - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 37&t=43154
[] and {} already allow trailing commas in v2.

Re: blanks in ternary operator

Posted: 25 Jan 2018, 17:33
by lexikos
If you are passing "", you are not omitting the parameter. "" is not a variable. For these built-in functions, the parameters are marked as "output variables", meaning only a variable is valid, and it must be writable.

ByRef does not require a variable, because that would defeat the ability to define a function to accept a varying number of variables. This might change if variadic functions are somehow improved to support variable references.

There is no good reason to pass "" when you mean to omit the parameter. If you get into that habit, you will get into trouble when you do it with a function which has a non-empty default value.