Ceylon language

spir denis.spir at gmail.com
Thu Apr 14 12:58:46 PDT 2011


On 04/14/2011 09:06 PM, bearophile wrote:
>> But I guess optionality could, and should, extend to non-ref types; thus, null
>> >  is just a particular case of non-existence. And this would apply especially on
>> >  function parameters:
>> >      void f (int i?) {...}
>  From C# experience it seems non-ref nullable types are not so useful (and it's not hard to implement them with the language itself).

Dunno C# at all.
But I find optionality far more useful for non-ref types, since in the general 
case there is no truelly special or invalid value like null. What value means 
undefined/inexistent/non-provided, for an int? a bool? Unlike for ref'ed types 
(actual pointers/classes/arrays) we simply cannot express this without language 
support.
This also leads to actual distinction of null and [] or "" for arrays & 
strings. Just dreaming...

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list