[Mono-list] Object additional implicit operator.

d3x0r d3ck0r at gmail.com
Fri Aug 15 12:43:08 EDT 2008




Chris Howie-3 wrote:
> 
> On Thu, Aug 14, 2008 at 8:59 PM, d3x0r <d3ck0r at gmail.com> wrote:
>> Since this is open source, I was going to patch my own copy to add an
>> extension to 'Object'.
>>
>> public static implicit operator bool( Object o ) {
>>  return (o!=null);
>> }
> 
> http://icanhascheezburger.files.wordpress.com/2007/01/1155341618648.jpg
> 
> Because I don't like seeing constants in code - and null is a constant.
> 
>> I got really used to testing to objects as...
> 
> I got used to storing random properties on objects in Perl, but I'm
> not hacking the runtime so I can do that in C# too.  :)
> 
> The best thing would be to unlearn this habit, not modify Mono to
> conform to your coding style.  You're going to be writing invalid C#
> with it.
> 
> -- 
> Chris Howie
> http://www.chrishowie.com
> http://en.wikipedia.org/wiki/User:Crazycomputers
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 

-- 
View this message in context: http://www.nabble.com/Object-additional-implicit-operator.-tp18992151p19001863.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list