www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Properties -- another one that gets me

reply Bill Baxter <wbaxter gmail.com> writes:
Just remembered this other real example of a D property that caused me
discomfort:

  .transform

I wanted it to be an unambiguous property that returns the transform
of an object, but it's too easy to misinterpret as an action that
transforms the object if it can be called as

   .transform().

--bb
Jul 28 2009
next sibling parent Ary Borenszweig <ary esperanto.org.ar> writes:
Bill Baxter escribió:
 Just remembered this other real example of a D property that caused me
 discomfort:
 
   .transform
 
 I wanted it to be an unambiguous property that returns the transform
 of an object, but it's too easy to misinterpret as an action that
 transforms the object if it can be called as
 
    .transform().
 
 --bb
Maybe we should start programming in another natural language and that's it.
Jul 28 2009
prev sibling parent reply downs <default_357-line yahoo.de> writes:
Bill Baxter wrote:
 Just remembered this other real example of a D property that caused me
 discomfort:
 
   .transform
 
 I wanted it to be an unambiguous property that returns the transform
 of an object, but it's too easy to misinterpret as an action that
 transforms the object if it can be called as
 
    .transform().
 
 --bb
.transformed :)
Jul 29 2009
parent reply Bill Baxter <wbaxter gmail.com> writes:
On Wed, Jul 29, 2009 at 8:11 AM, downs<default_357-line yahoo.de> wrote:
 Bill Baxter wrote:
 Just remembered this other real example of a D property that caused me
 discomfort:

 =A0 .transform

 I wanted it to be an unambiguous property that returns the transform
 of an object, but it's too easy to misinterpret as an action that
 transforms the object if it can be called as

 =A0 =A0.transform().

 --bb
.transformed :)
It returns the affine transform itself, not a transformed object. --bb
Jul 29 2009
parent downs <default_357-line yahoo.de> writes:
Bill Baxter wrote:
 On Wed, Jul 29, 2009 at 8:11 AM, downs<default_357-line yahoo.de> wrote:
 Bill Baxter wrote:
 Just remembered this other real example of a D property that caused me
 discomfort:

   .transform

 I wanted it to be an unambiguous property that returns the transform
 of an object, but it's too easy to misinterpret as an action that
 transforms the object if it can be called as

    .transform().

 --bb
.transformed :)
It returns the affine transform itself, not a transformed object. --bb
Oops. Not sure what I was thinking there.
Jul 29 2009