Consistency:HasKey and variadic array paths

Propose new features and changes
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Consistency:HasKey and variadic array paths

13 May 2017, 10:42

Since some update it is possible to access objects and arrays via variadic syntax:

Code: Select all

value := array[ path* ]
This was one of the best things that has happened to AHK recently.
What I'm asking for is that .hasKey( key ) should reflect this change.

What I'm asking for is that every path that you can put inside the [ ] after an array the same path input in the same way into .hasKey should produce a result:

Code: Select all

arr[]         : arr.hasKey()
arr[key]    : arr.hasKey(key)
arr[x,y]    : arr.hasKey(x,y)
arr[path*] : arr.hasKey(path*)
I think this sort of consistency would really make things easier to program and to understand.
I do already know several solutions to this that you need to use depending on the occasion.
Recommends AHK Studio

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 29 guests