dereference

Dereferencing is strictly a computer-programming issue, but we will try to explain it in very brief and comprehensible terms, so that you understand the idea of dereferencing and its practical effect when data structures are copied.

Let's say we want to compose a list of a few automobiles. Each entry in the list will contain the fields model, year and mileage.

Theoretically speaking, to solve this real-world problem with the help of a computer, we would create a template (containing the three fields), and produce one instance of the template for each car we add to our list. (How this list is created, how the elements are added and how they relate to each other is irrelevant here).

One imaginary list with three instances could be visually represented in the following way:

             Model     Year  Mileage
  list[0] { 'Fiat',    1996, 177940 }
  list[1] { 'Citroen', 2001, 66000  }
  list[2] { 'Citroen', 2002, 23000  }

There is only one copy of this list in computer memory, and we read or modify the elements by obtaining references (or, pointers) to appropriate entries.

If we take list above to contain the list of references to the entries, we can use list[0].Model to retrieve the value "Fiat", or list[2].Year to retrieve "2002". For both of those fields, a reference was first dereferenced (or, followed) to reach the actual data fields.

When list elements need to be copied to another location (usually as part of some bigger plan which, again, we are not interested in), they can be copied by value (with dereferencing) or by reference (obviously, without dereferencing). With copy by value, you would end up with 2 references and 2 different lists (initially they would be the same but afterwards you could modify each with no connection to the other). In case of copy by reference, you would again have 2 references, but both pointing to the same list. Modifying data through any of the two references would have impact on both.

So, when a data structure (or its element) is said to be copied without dereferencing, then in case it was a reference, it is still copied in itself, but all copies point to the same location. In other words, the data is not duplicated, only the access points are.

DocBook! Interchange!