Re: Re: Check this out for a good laugh
Imam Tashdid ul Alam <[email protected]> Thu, 15 Sep 2005 07:04:44 -0700 (PDT)
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
thanks Artem for your answers. but I guess I didn't ask the right questions after all. so, T! is the "option type" for T, right? because T? is the "nullable type" and it's already in C#. T? meaning it's value is either a T object or null. T! meaning it must be a T object. T meaning we don't care, so for [T resolves to List] it means T can either be a List or null, but naturally for [T resolves to int] the null case cannot possibly arise because it is a primitive thing. am I right? Nice is much more coherent in my opinion. there should be no syntactic difference between different types, but that might be a very idealistic approach, I am not sure. > I don't quite get your question, but there is a > "null pointer check"=20 > performed by some compilers (GCC) to throw the > NullPointerException, and=20 > one of optimizations they planning is this null > pointer check removal,=20 > but these optimizations, even if implemented, are > limited to some local=20 > scope, so having optional types in the language > itself might improve the=20 > performance. the sort of optimization you are talking about is of course welcome, but I was basically worried about this: if the language does not make *any* distinction between primitive types and reference types, should this affect performance? I guess the only reason Java decided that int's won't inherit Object was this performance issue. or maybe I am wrong. if you call a method with either an integer variable or a struct (in C#, they are value types), the value is copied and anything you do to them (like changing the value of a field in the copied structure) does not affect the original. so structs are passed by value. M$ claims that as for this strategy (the copy of) the struct is placed in a stack rather than allocated in a heap, things are faster. so structs being lightweight pays off. are they right? =09 __________________________________=20 Yahoo! Mail - PC Magazine Editors' Choice 2005=20 http://mail.yahoo.com ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server.=20 Download it for free - -and be entered to win a 42" plasma tv or your ver= y own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php