Opened 16 months ago

Last modified 9 months ago

#3969 new Feature Request

Map Initializer List — at Initial Version

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Map, Initializer List Cc:

Description

; For Arrays, we can use
Global $a = [1, 2, 3]
; or
Global $a[] = [1, 2, 3]
; or
Global $a[3] = [1, 2, 3]

; But if we create a Map, it is always empty, and there is no good way to initialize Maps. So here is a suggestion:

Global $a["key1", "key2", "key3"] = [1, 2, 3]

; is the same as

Global $a[]
$a["key1"] = 1
$a["key2"] = 2
$a["key3"] = 3

; I'm sure we do not "need" this feature, but it would be nice to have. (the same argument could be made for Array-Initialization with initializer list... we do not "need" it, but it is nice that it exists)

Change History (0)

Note: See TracTickets for help on using tickets.