On Friday, January 27, 2023 at 9:08:16 AM UTC-5,
gnuarm.del...@gmail.com wrote:
> On Friday, January 27, 2023 at 9:13:19 AM UTC-4, KJ wrote:
> > On Thursday, January 26, 2023 at 12:24:16 PM UTC-5,
ashokm...@gmail.com wrote:
> > > On Wednesday, January 25, 2023 at 7:25:18 PM UTC-8,
gnuarm.del...@gmail.com wrote:
> > > > On Wednesday, January 25, 2023 at 1:36:29 PM UTC-4,
ashokm...@gmail.com wrote:
> > > > > On Tuesday, January 24, 2023 at 11:48:22 AM UTC-8,
gnuarm.del...@gmail.com wrote:
> > > > > > On Tuesday, January 24, 2023 at 2:34:22 PM UTC-5,
ashokm...@gmail.com wrote:
> So is that the same as having the value NULL? Isn't NULL the indication of pointing to nothing?
>
For your first question: The VHDL variable is an access type (similar to but not the same as a C/C++ pointer). That variable will have a value which can be the literal null per the standard. If the value of the variable is null, then the standard is saying that you can't access anything with the variable because there is no object to access (per standard "access value designating no object at all."). The ability (or inability) to access something in VHDL is not the same thing as being able to dereference a pointer in software.
For your second question: Yes.
> If it were uninitialized, it could have any value at all.
Not sure what "it" is that you are referring to but a VHDL variable will never have "any value at all". The OP's declaration of variable 'Head', because this is VHDL, means that the compiler will assign the value of null in the OP's code. The same would not be true for a similarly declared pointer in C/C++. In that situation, the C/C++ variable could have 'any value at all' and would be pointing to who knows what.
> You've not said it is unitialized, and you have not said it contains NULL.
The access type variable's value is the literal null (not the literal 0 or anything but 'null').
> "Pointing to nothing" is not clear unless you mean it contains a NULL.
I quoted the standard and then applied the interpretation that I thought would help the OP understand. What I said was
> "designating no object at all" meaning it doesn't 'point' to anything
> You even say "VHDL assigns the variable the 'value' null". So isn't that an adequate explanation rather than the much more wordy statement, "pointing to nothing"? That's the point of "null", it points to nothing.
Well if you didn't like the longer answer, you should have stopped at the short answer that I gave.
You and the OP have been going back and forth for a bit but the OP was still confused about "where does Head point to when it is first declared", so I was just suggesting an alternative explanation and quoting from the standard as the reference. Maybe it helps the OP understand, maybe not.
Kevin Jennings