Re: arrays = pointers?



On Thu, 01 Mar 2007 03:57:17 +0800, Göran Andersson <guffa@xxxxxxxxx> wrote:

The documentation actually uses the term "pointer", but that is used for pointers. :)

Sorry...I didn't think it was necessary to explicitly state that I was simply talking about what the .NET documentation uses to describe references. Of course it uses the word "pointer" elsewhere, just as it uses all sorts of other words that also do not describe .NET references.

Yes, it's much simpler than any of those two. The inner workings of a reference is just a pointer, nothing more. What makes a reference different from a pointer is simply how the compiler allows you to use it.

It is obviously not "just a pointer". Either the compiler, or the .NET Framework, or both, hide the inner workers from the programmer. But for the reference to be relocatable, *some* kind of extra work has to be done. Whether that is for the reference to be a pointer to a pointer, or if there is some table of relocatable pointers somewhere, or something else, I don't know. But clearly for .NET to be able to relocate the object that a reference refers to, there must be more than just a simple pointer to that object.

Pete
.



Relevant Pages

  • Re: Question on LSP
    ... Sure, the developer must keep track of which type has been assigned to each pointer to manage complexity in creating the design, which is why the 'T' is in T*. ... Subtyping is a relation which does not ... Those object types are completely orthogonal to the semantics of being an object reference. ... aggregate references, is the aggregate of referenced objects or target ...
    (comp.object)
  • Re: Question on LSP
    ... Because construction paradigms have different goals. ... But that has nothing to do with what a pointer type ... But that does not mean that the semantics of an object reference is ... aggregate references, is the aggregate of referenced objects or target ...
    (comp.object)
  • Re: Question on LSP
    ... equivalent addresses in the same context. ... Note that the language allows us to use a name like 'T' on the reference as a mnemonic so that the developer can keep track of what is happening with the indirection. ... Modern languages have proper pointer types. ...
    (comp.object)
  • Re: Nothing Keyword Destories Objects rather than just resetting the variable to an empty variable
    ... there is no difference between using ByVal or ByRef. ... as the C1 pointer was the sole reference to the class object. ... Yes, an object variable is a pointer to an object, but that is the only ... the keyword "NOTHING" should only destroy the ...
    (microsoft.public.excel.programming)
  • Re: How java passes object references?
    ... to think of them as being a specific location in a larger block of memory ... Whether a language passes by reference or by value, ... is a pointer pointing at the memory block. ... So when allocating local memory for o, it would simply allocate a ...
    (comp.lang.java.programmer)

Loading