some suggestion of v2-beta

Discuss the future of the AutoHotkey language
User avatar
hyaray
Posts: 85
Joined: 20 Jun 2015, 01:37
Contact:

some suggestion of v2-beta

Post by hyaray » 14 Oct 2022, 11:08

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.

lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: some suggestion of v2-beta

Post by lexikos » 14 Oct 2022, 18:11

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.

User avatar
hyaray
Posts: 85
Joined: 20 Jun 2015, 01:37
Contact:

Re: some suggestion of v2-beta

Post by hyaray » 14 Oct 2022, 20:12

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.

sirksel
Posts: 222
Joined: 12 Nov 2013, 23:48

Re: some suggestion of v2-beta

Post by sirksel » 07 Nov 2022, 08:15

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.

lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: some suggestion of v2-beta

Post by lexikos » 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)

sirksel
Posts: 222
Joined: 12 Nov 2013, 23:48

Re: some suggestion of v2-beta

Post by sirksel » 07 Nov 2022, 19:04

Even better. Listen to lexikos!

User avatar
hyaray
Posts: 85
Joined: 20 Jun 2015, 01:37
Contact:

Re: some suggestion of v2-beta

Post by hyaray » 06 Dec 2022, 22:14

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.

iseahound
Posts: 1437
Joined: 13 Aug 2016, 21:04
Contact:

Re: some suggestion of v2-beta

Post by iseahound » 07 Dec 2022, 11:13

Actually I use StrLower() to standardize inputs. m[StrLower("A")] := "apple" is an alternative.

Post Reply

Return to “AutoHotkey Development”