May 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #9 from Steven Schveighoffer <schveiguy@yahoo.com> 2012-05-19 09:13:32 PDT ---
I'm just saying, that might be what it means, but is just poorly explained. Taking address of member on the class has been around since D1

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #10 from Stewart Gordon <smjg@iname.com> 2012-05-19 09:18:15 PDT ---
(In reply to comment #9)
> I'm just saying, that might be what it means, but is just poorly explained. Taking address of member on the class has been around since D1

Maybe.  But it can't possibly be intended that type type of &Test.foo is void
function().  It would have to be void function(Test).  And the spec would have
to explicitly allow it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #11 from wfunction@hotmail.com 2012-05-19 12:20:00 PDT ---
(In reply to comment #5)
> http://dlang.org/type.html#delegates
> "There are no pointers-to-members in D"

There aren't though. Pointers to members are data types that relative to a certain class.

Functions and delegates aren't relative to any class, they're absolute.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #12 from Stewart Gordon <smjg@iname.com> 2012-05-19 16:22:55 PDT ---
(In reply to comment #11)
> (In reply to comment #5)
> > http://dlang.org/type.html#delegates
> > "There are no pointers-to-members in D"
> 
> There aren't though. Pointers to members are data types that relative to a certain class.

What dictionary are you going by?

> Functions and delegates aren't relative to any class, they're absolute.

This is only a matter of how C++ happens to notate pointer-to-member types and the dereferencing thereof.  (At least a pointer to a member function - a pointer to a member variable is a whole different beast.)  Below this level, it's just a function type, the class it's "relative to" just being the type of the implicit this parameter.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #13 from wfunction@hotmail.com 2012-05-19 17:24:47 PDT ---
(In reply to comment #12)
> What dictionary are you going by?

C++'s, since that's the only one I've seen that ever mentions the phrase "pointer to member". :P

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #14 from Stewart Gordon <smjg@iname.com> 2012-05-19 17:49:37 PDT ---
(In reply to comment #13)
> (In reply to comment #12)
> > What dictionary are you going by?
> 
> C++'s, since that's the only one I've seen that ever mentions the phrase "pointer to member". :P

There you go.  This explains only what the phrase means in a C++ context.

In a more general context, there's nothing to say a "pointer to member" must be a distinct type.

Suppose this issue is fixed by implementing the points of comment 10.  Then &Test.foo is a pointer to a member of Test.  It being just a void function(Test), rather than some other, distinct but semantically equivalent type doesn't change this fact.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #15 from wfunction@hotmail.com 2012-05-19 19:28:45 PDT ---
(In reply to comment #14)
> In a more general context, there's nothing to say a "pointer to member" must be a distinct type.


It depends on what you mean by "pointer to member".

If you say a VARIABLE is a pointer to a member, then yes, it doesn't have to have a distinct type.

If you say a TYPE is a pointer to a member, then (by definition), it is a
distinct type. (Otherwise, how do you distinguish between a type that is a
pointer-to-member vs. one that isn't?)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114



--- Comment #16 from Stewart Gordon <smjg@iname.com> 2012-05-20 06:45:56 PDT ---
(In reply to comment #15)
> It depends on what you mean by "pointer to member".

If it means there are no pointer-to-member _types_ in D, then that's what it should say.

> If you say a VARIABLE is a pointer to a member, then yes, it doesn't have to have a distinct type.
> 
> If you say a TYPE is a pointer to a member, then (by definition), it is a
> distinct type. (Otherwise, how do you distinguish between a type that is a
> pointer-to-member vs. one that isn't?)

You wouldn't.  They'd be one and the same type.  I don't see any reason for them to be distinguished.

If OTOH you implement a pointer-to-member as an index into the vtbl, so that it calls the correct method implementation for the object's subclass, _then_ you need a distinct type for it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 28, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8114


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |DUPLICATE


--- Comment #17 from yebblies <yebblies@gmail.com> 2012-10-29 07:47:38 EST ---
*** This issue has been marked as a duplicate of issue 3720 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »