Page 1 of 1

double (de)reference vs double-deref

Posted: 30 Nov 2019, 23:28
by jeeswg
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.

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 07:58
by swagfag
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?

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 09:02
by guest3456
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

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 12:32
by jeeswg
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

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 19:03
by guest3456
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?

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 19:43
by jeeswg
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

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 20:31
by gregster
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.

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 22:08
by guest3456
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.

Re: double (de)reference vs double-deref

Posted: 01 Dec 2019, 23:04
by jeeswg
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.