POV-Ray : Newsgroups : povray.off-topic : new C# stuff : Re: new C# stuff Server Time
6 Sep 2024 15:21:16 EDT (-0400)
  Re: new C# stuff  
From: Darren New
Date: 22 Jan 2009 12:51:55
Message: <4978b23b$1@news.povray.org>
Warp wrote:
>   Basically, it seems, that instead of having to write, for example,
> "someFunction(anObject)" you can write "anObject.someFunction()".

Syntax sugar. And let lets you do things like
   "Hello".toUpper().myConversion().trim("o")
so you can chain them together.

The same benefit you get in C++ from being able to make classes with no 
virtual members.  You often talk about how you can have an array of points 
in C++ without any extra overhead and still treat them like objects, yes? 
Same sort of thing here.

Note too that it might interact with overloading and implicit casts.

short s = ...;
s.myThing();  // I know what this calls.
yourThing(s); // Does this cast "s" to an integer first?

-- 
   Darren New, San Diego CA, USA (PST)
   "Ouch ouch ouch!"
   "What's wrong? Noodles too hot?"
   "No, I have Chopstick Tunnel Syndrome."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.