[Wish:] Wish FileApend (a,b,c) to throw as well as any functions

Discuss the future of the AutoHotkey language
User avatar
V2User
Posts: 195
Joined: 30 Apr 2021, 04:04

[Wish:] Wish FileApend (a,b,c) to throw as well as any functions

07 Sep 2023, 02:56

Currently, FileApend (a,b,c) with a space between FileApend and (a,b,c), will run undefinedly. Because (a,b,c) will return c, then run FileApend(c). So, once you accidentally insert a space between them, the behavior would be undefined and might be extremely difficult to check out. This is not in line with our original intention in debug. We should have focused our attention on the substantive issues when debugging.
Writing something nearly identical as functions but totally different, is not permitted by reading even if it's permitted by syntax.
Therefore, I wish any function call like FXXX () would throw an error.
Last edited by V2User on 11 Sep 2023, 22:50, edited 3 times in total.
User avatar
V2User
Posts: 195
Joined: 30 Apr 2021, 04:04

Re: [Wish:] Wish FileApend (a,b,c) to throw as well as any functions

07 Sep 2023, 08:43

Of course, maybe code extension of VSCode can do that. It would actually be solved if extension could offer tips for that. :)
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: [Wish:] Wish FileApend (a,b,c) to throw as well as any functions

10 Sep 2023, 21:12

It will not "run undefinedly", whatever that means. (a,b,c) is a valid multi-statement expression, which evaluates to c. It is the same as FileAppend c if a and b have no side-effects.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 73 guests