ufcs and integer params

Jonathan M Davis jmdavisProg at gmx.com
Sat Jul 14 20:40:31 PDT 2012


On Sunday, July 15, 2012 05:30:55 Jay Norwood wrote:
> I see from this other discussions that it looks like 2.059 ( or
> maybe 2.060) does support something like 3.cm().   Not sure from
> the discussion if it would also accept 3.cm as in the xtext/xtend
> example.
> 
> http://forum.dlang.org/thread/smoniukqfxerutqrjshf@forum.dlang.org

UFCS (universal function call syntax) was added in 2.059. If cm is a function, 
then 3.cm() will work. If it's a property function, then 3.cm will work. If 
you don't compile with -property, then 3.cm will still work with cm being a 
non-property function, but -property will become the normal behavior 
eventually, so you shouldn't expect that 3.cm will work long term unless cm is 
a property function.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list