[Suggestion:] Introduce ?= for ?? Topic is solved

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

[Suggestion:] Introduce ?= for ??  Topic is solved

Post by V2User » 16 Jan 2023, 09:50

Wish introduce ??=/?= operator for ?? just like what many other assignment operators did, such as +=,.= etc.
As we know, many of operators in V2 have a corresponding assignment operator. a:=a+b is equivalent to a+=b, a:=a&b is equivalent to a&=b. It seems that there is no mater for ?? to also have one, i.e.a:=a??b will be totally equivalent to a?=b. How fortunately, when ? is closely followed by =, it will not be hard for the parser to handle, I guess, despite that ternary operator also contains a ?.
Of course, it's not a must to implement this feature right now. But codes will obviously become simpler if supported. Whenever and wherever you want to handle some "maybe-unset" variables, you will probably enjoy a smooth coding with ?= in V2. :xmas:
Last edited by lexikos on 12 Aug 2023, 06:59, edited 1 time in total.
Reason: Implemented in v2.1-alpha.2

Return to “AutoHotkey Development”