[v2] Add A_Offset for zero-based memory functions

Propose new features and changes
iseahound
Posts: 1456
Joined: 13 Aug 2016, 21:04
Contact:

[v2] Add A_Offset for zero-based memory functions

12 Jan 2023, 14:23

A_Offset starting from zero, would be a clearer alternative to (A_Index-1). This would have no impact on the current one-based indexing in AutoHotkey.
image.png
image.png (61.55 KiB) Viewed 935 times
In any case, starting from zero or one has always depended on what one practically means as they could be thinking about the number of offsets from the beginning or the index of the current element. To put it succulently, both sides have been talking over each other because they have been talking about different things.


A short story on William James and the squirrel
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: [v2] Add A_Offset for zero-based memory functions

12 Jan 2023, 21:59

presumably you're talking about this builtin variable occuring inside loops, in which case, i think it'd be better named to be simply A_ZeroIndex or something, since offset is only one of many possible use cases for this inside of a loop

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

Re: [v2] Add A_Offset for zero-based memory functions

16 Jan 2023, 09:51

It's like moving from point A to point B in a series of steps, where each step spans an interval. If it takes me 3 steps, one, two, three, then I have also crossed 3 intervals.

Imagine standing on the shore and seeing 3 islands in the distance. A bridge builder would build 3 bridges to connect 3 islands, with each bridge spanning from the previous island to the next. But it would be incorrect to view the world in terms of all bridges or islands. It should appear that it is merely a coincidence that the number of bridges is equal to the number of islands. (Because you may be standing on an island yourself!)

Just as I wouldn't conflate islands and bridges,
steps and intervals,
I see no reason why offset and index would not suffice.

A_ZeroBridge hardly makes any sense.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 25 guests