Other language features you'd want in D
Denton Cockburn
diboss at hotmail.com
Fri Feb 22 16:35:48 PST 2008
On Fri, 22 Feb 2008 15:25:24 -0800, Robert Fraser wrote:
> Denton Cockburn wrote:
>> What are some features found in other languages that you believe would be
>> really good to have in D?
>>
>> These can be language features or library features.
>>
>> It shouldn't be any of the general items found in the comparison FAQ (like
>> Multiple inheritance). Something that's relatively nice and specific.
>>
>> e.g.
>> I miss multiple value returns found in Lisp. Out parameters are not
>> nearly as nice.
>>
>> P.S. Has anyone thought to write a document on some of the struct tricks
>> that I've been seeing mentioned? They exploit struct features, but I
>> think only a select few understand them.
>
> Initializing runtime constants without a static this() a la Java,
>
> class C
> {
> static int x = someRuntimeInitializer(10);
> int y = someRuntimeInitializer(20);
> }
I don't mind the static this() thing much. It puts all the initialization
in one place.
I hated having to read this in java:
class Foo {
/* variables with inits */
/* some functions */
/* some variables with inits that were added to the class later */
}
I will admit that it's quite a bit more typing though, especially with
many defaulted variables.
More information about the Digitalmars-d
mailing list