HaxeManual icon indicating copy to clipboard operation
HaxeManual copied to clipboard

Optional arguments vs default values

Open Gama11 opened this issue 8 years ago • 1 comments

I find the pages on optional arguments and default values a bit confusing. They fail to mention that optional arguments are just syntactic sugar for a default value of null / that ?param:SomeType is the same as param:Null<SomeType> = null. To somebody that doesn't know that, it can read like optional arguments and default values are entirely different things.

Gama11 avatar Nov 22 '17 10:11 Gama11

https://github.com/HaxeFoundation/haxe/issues/7378#issuecomment-418139433

Simn avatar Sep 04 '18 10:09 Simn