double (de)reference vs double-deref

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

double (de)reference vs double-deref

Post by jeeswg » 30 Nov 2019, 23:28

Seen here:
double reference vs double-deref · Issue #298 · Lexikos/AutoHotkey_L-Docs · GitHub
https://github.com/Lexikos/AutoHotkey_L-Docs/issues/298
The most common form of dynamic variable reference is called a double reference or double-deref.

Shouldn't that be called a double dereference?

No. A variable reference can be passed to a function and not dereferenced. In that context, a dynamic variable reference would be a double reference, but only a single level dereference (from %y% to whatever variable is named within).
Any further info? Thanks.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: double (de)reference vs double-deref

Post by swagfag » 01 Dec 2019, 07:58

any further info about what? do u have a specific question in mind? is something unclear? do u have any gripes with anything?

what is the point of this thread?

guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: double (de)reference vs double-deref

Post by guest3456 » 01 Dec 2019, 09:02

swagfag wrote:
01 Dec 2019, 07:58
any further info about what? do u have a specific question in mind? is something unclear? do u have any gripes with anything?

what is the point of this thread?
my thoughts too


User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: double (de)reference vs double-deref

Post by jeeswg » 01 Dec 2019, 12:32

OK then, please assist the forum, by adapting this code, to explain the following 4 terms, in the clearest language possible:
A 'double-ref', a double-deref, a double reference and a double dereference.

Code: Select all

def := "abc"
ghi := "def"
MsgBox, % %ghi% ;abc
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: double (de)reference vs double-deref

Post by guest3456 » 01 Dec 2019, 19:03

jeeswg wrote:
01 Dec 2019, 12:32
OK then, please assist the forum, by adapting this code, to explain the following 4 terms, in the clearest language possible:
A 'double-ref', a double-deref, a double reference and a double dereference.

Code: Select all

def := "abc"
ghi := "def"
MsgBox, % %ghi% ;abc
you didn't answer any of swagfag's questions.

why didnt you ask Lexikos directly in the PR convo about this exact issue?


User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: double (de)reference vs double-deref

Post by jeeswg » 01 Dec 2019, 19:43

I've come up with some more specific questions:

Scripting Language | AutoHotkey v2
https://lexikos.github.io/v2/docs/Language.htm
The most common form of dynamic variable reference is called a double reference or double-deref.

What are the other forms of dynamic variable references?

Is a double-deref the same thing as a double dereference?
Perhaps the documentation should say:
'The most common form of dynamic variable reference is called a double reference or double-deref (double dereference).'

But further to this:
Are a double reference and a double-deref the same thing. (Surely not, but the sentence implies that they are, or at least, that's the more natural way to read the sentence.)
'The most common form of A is a B or a C.' [a B is also called a C]
'The 2 most common forms of A, are a B and a C.'

Link:
c - meaning of "referencing" and "dereferencing" - Stack Overflow
https://stackoverflow.com/questions/14224831/meaning-of-referencing-and-dereferencing



@guest3456:
Spoiler
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

gregster
Posts: 8921
Joined: 30 Sep 2013, 06:48

Re: double (de)reference vs double-deref

Post by gregster » 01 Dec 2019, 20:31

I would recommend to keep meta-discussions (especially personally tinged ones) completely out of this 'Ask for Help' topic ("double (de)reference vs double-deref"), at least from now on - ideally in all topics that are not specially designated as meta-discussions.

If someone sees added value for the community in continue discussing best practices for the 'Ask For help' section, please open a general topic - without fingerpointing - in 'General Discussion' or similar, or discuss it privately.

Traditionally, this subforum is a very free-form and lenient one, but this is all your umpteenth rodeo and your personal differences are well-known. Re-runs are only entertaining if they occur every few years.

If you still have questions, feel free to drop me a PM.

guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: double (de)reference vs double-deref

Post by guest3456 » 01 Dec 2019, 22:08

jeeswg wrote:
01 Dec 2019, 19:43
I've come up with some more specific questions:
good job. :clap:
jeeswg wrote:
01 Dec 2019, 19:43
Scripting Language | AutoHotkey v2
https://lexikos.github.io/v2/docs/Language.htm
The most common form of dynamic variable reference is called a double reference or double-deref.
What are the other forms of dynamic variable references?
on the same docs page, literally 2 paragraphs underneath your quoted setenece
jeeswg wrote:
01 Dec 2019, 19:43
Is a double-deref the same thing as a double dereference?
Perhaps the documentation should say:
'The most common form of dynamic variable reference is called a double reference or double-deref (double dereference).'

But further to this:
Are a double reference and a double-deref the same thing. (Surely not, but the sentence implies that they are, or at least, that's the more natural way to read the sentence.)
'The most common form of A is a B or a C.' [a B is also called a C]
'The 2 most common forms of A, are a B and a C.'
no idea, would be a good question for lexikos, since he initially wrote the doc and then re-confirmed that there was no error when Ragnar asked about it. ask him what he meant by those terms.


User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: double (de)reference vs double-deref

Post by jeeswg » 01 Dec 2019, 23:04

Thanks. I did consider whether 'one or more pieces' counted as a distinct form of dynamic variable reference, or not. (Pseudo-arrays and associative pseudo-arrays would fall within this category.)

Scripting Language | AutoHotkey v2
https://lexikos.github.io/v2/docs/Language.htm#dynamic-variables
A dynamic variable reference can also take one or more pieces
...
Pseudo-arrays [e.g. MyArray1, MyArray2, MyArray3, ...]
...
Associative pseudo-arrays [e.g. MyArrayX, MyArrayY, MyArrayW, MyArrayH]

But, is %var% really a different concept from my%var% or %var%%var%, or just a subset of it ('one piece' v. 'one or more pieces').
Also, none of 'one or more pieces'/pseudo-arrays/associative pseudo-arrays are a particularly good name for the overall concept (of a distinct form of dynamic variable reference).

When I read 'The most common form of dynamic variable reference', there isn't some completed list (of forms of dynamic variable references) that obviously jumps out at me. So, any clarification here would be most welcome.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Post Reply

Return to “Ask for Help (v1)”