Re: Fat arrow =>
Posted: 31 Mar 2018, 06:05
I'd say it would be nice, but your particular example can be acheived with ?:. And as said by lexikos, the benefits diminishes when the function becomes longer. In particular, I think mulitline function definitions in a function call becomes quite ugly with only a few lines of code, and especially if it is not in the last parameter, or if done in mulitple parameters. Further, when naming a function, it is much more sensical to me, to do so separate from a function call. So you might aswell use a nested function for more elaborate code. Eg,
cheers.
Code: Select all
myFunc(){
gui := guicreate()
Gui.OnEvent( "Close", "closeApplication")
closeApplication(){ ; Adding '=>' here adds no convenience
if ( msgbox( "Do you really want to exit?") = "Yes" ) ;imagine the button options as Yes/No
ExitApp()
}
gui.show("w200 h200")
}