[AccessD] Can a function return an object?

Bill Benson bensonforums at gmail.com
Sun Mar 26 22:37:29 CDT 2023


Thanks gents. I guess I will use my option to dislike the word. To me,
dereferencing ought not to mean to uncover a hidden thing that something
else is referring to, since there is no DE (to remove or get away from).

The simplest analogy:  If I “decouple” two ideas, it means that they can be
examined and evaluated without regard to one another. This is not the case
with how the claim here is that dereferencing is used. In what way does
dereferencing cause one to be allowed to change the underlying data without
changing the reference? Only a new assignment statement would cause that.

Anyway I don’t really have a dog and this isn’t really a fight. It is just
one of those times when I feel I am being made to accept someone else’s
word and the reasoning behind it or go home.

On Sun, Mar 26, 2023 at 5:57 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:

> You are conflating ideas and over complicating thiings:
>
> Oxford dictionary:
>
> dereference something to use a piece of data to discover where another
> piece
> of data is held.
>
> Wiktionary:
> dereference
>
> Wiktionary
> https://en.wiktionary.org > wiki > dereference
>
>
> (programming) To access the value or object located in a memory location
> stored in
> a pointer or another value interpreted as such;
>
> The concepts of "reference count" and "garbage collection " is what you
> are thinking about
> and it is something else entirely
>
> "deferencing" and " acquiring and releasing  references"  are two entirely
> different conepts.
>
> Reference counting is necessary so that shared memory used by  objects is
> released when it
> is no longer needed.
>
> Fundanetally, ALL pointers just point to a memory location.  How your
> application handles
> what is at that location(and following locations) is up to you.  It's just
> a string of bytes.
>
> If it's a pointer to a function or object, it's generall called a Code
> Pointer  and you would
> CALL the code at that location (that's the basis of sub-classing (which
> VBA can't do) and
> Callbacks.
>
> Here's a couple of examples of using a Code Pointer:
>
> WinHTTPStatusCallback is the name of a function which a WInHTTPRequest()
> can use to
> supply information about the progress of the request.
>
> fStatus =
> WinHttpSetStatusCallback(hRequestHandle,CODEPTR(WinHTTPStatusCallaback,
> _ %WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS,BYVAL %NULLl)
>
>
> or subclassing an edit control (textbox)
>
> FUNCTION EditSubCLassProc(.......
> ...
> oldProc = SetWindowLong(hEdit, %GWL_WNDPROC, CODEPTR(EditSubClassProc))
>    .
>
> --
> Stuart
>
> On 26 Mar 2023 at 7:25, John Colby wrote:
>
> > The interpreter keeps track of how many objects are referencing a
> > given object.  It does this for garbage collection purposes at the
> > very least.
> ...
> > So it truly isn't as simple as 'here is a pointer to a memory
> > location', have fun with it.  the system has to handle this reference
> > count thingie.
> >
> > Similarly a pointer or reference points to an object.  The object is
> > different depending on what is being referenced.  The footprint in
> > memory is going to be different for a string as opposed to a form as
> > opposed to a recordset.  How the object is used, what you can do with
> > it, An object such as a class can have entire sections of code as well
> > as data.  In some languages an object like a string also has code
> > which can do things like upper or lower or proper case it etc.
> >
> > So just handing around pointers to objects is problematic.  I assume
> > (out of extreme ignorance of the subject) that every object has a
> > descriptor which tells the caller what it is and how to use said
> > object.  So the process of 'getting back' or using any object is going
> > to be an entire process.  I simply assumed this process is what
> > 'dereferencing' means.
> >
> > I have never found it necessary to understand the details of
> > dereferencing.  I just have a high level concept of 'it must do this
> > kind of thing' to use the object referenced.
> >
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list