Page 1 of 1

some suggestion of v2-beta

Posted: 14 Oct 2022, 11:08
by hyaray
I have some suggestion of v2-beta, :dance:
1. A_LineDir, A_UserProfile, A_LocalAppdata can be added.
2. map CaseSence should be default to false.
3. integer, string, array, map should add simple methods for use, maybe everyone have to write a lot lib.
4. IndexError make array hard to use
5. json should be added.

Re: some suggestion of v2-beta

Posted: 14 Oct 2022, 18:11
by lexikos
I disagree about 2 and 4, but it is a moot point because:
Current state: AutoHotkey v2 has been in beta since July 2021. Changes prior to the final v2.0.0 release should be of a minor nature (such as improvements to the error and warning dialogs), and should not affect the functionality of scripts. In other words, future releases are expected to be backward-compatible.
https://www.autohotkey.com/v2/
That's the point of being beta, not alpha.

Any new features will most likely be deferred until v2.1-alpha.

Feature requests are best posted in Wish List, one feature (or related group of features) per topic, preferably adding to topics that already exist. I'm sure most of what you ask for has been discussed before.

Re: some suggestion of v2-beta

Posted: 14 Oct 2022, 20:12
by hyaray
Thank you very much, I never know Wish List before :yawn:
I write AutoHotkey more than 7 years, map needs CaseSense just on less than 5 times.
At least, should add a #MayCaseSense, Maybe this is my final struggle :yawn:
So I use https://github.com/thqby/AutoHotkey_H for transition.

Re: some suggestion of v2-beta

Posted: 07 Nov 2022, 08:15
by sirksel
You probably already know this, but writing a mapi() function, that is the case-insensitive cousin of map(), is pretty straightforward. This is what I use, as a one-liner in my utility function library:

Code: Select all

mapi(p*) => (m := map(),  m.casesense := 'off',  m.set(p*))
You can just use it like you would map(), except that when you use mapi(), it is case-insensitive by default. You may have already done something like this, but if not, I hope that might be helpful.

Re: some suggestion of v2-beta

Posted: 07 Nov 2022, 17:27
by lexikos

Code: Select all

class Mapi extends Map {
    CaseSense := "Off"
}

m := Mapi("a", "alpha")
m["A"] := "apple"
MsgBox m["a"] " " Type(m) " " (m is Mapi)

Re: some suggestion of v2-beta

Posted: 07 Nov 2022, 19:04
by sirksel
Even better. Listen to lexikos!

Re: some suggestion of v2-beta

Posted: 06 Dec 2022, 22:14
by hyaray
lexikos wrote:
07 Nov 2022, 17:27

Code: Select all

class Mapi extends Map {
    CaseSense := "Off"
}

m := Mapi("a", "alpha")
m["A"] := "apple"
MsgBox m["a"] " " Type(m) " " (m is Mapi)
if Mapi is buildin, I'm glad to use it,
I don't want to define it personally. these are basic use case.

Re: some suggestion of v2-beta

Posted: 07 Dec 2022, 11:13
by iseahound
Actually I use StrLower() to standardize inputs. m[StrLower("A")] := "apple" is an alternative.