gc heap

Sam S E asdf at mailinator.com
Sun Nov 23 21:51:35 PST 2008


Jarrett Billingsley Wrote:

> On Sun, Nov 23, 2008 at 10:59 PM, Sam S E <asdf at mailinator.com> wrote:
> > See http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf.
> > There are some amazing feature listed there. I can't think of anything else I'd like to see implemented (except for automatic type inference of substructs in struct literals).
> 
> Ah, OK.  Yeah, I wonder if a good number of those features will make
> it into D anytime soon.  Walter already said macros will be put off
> until D3, which were one of the major things I was looking forward to
> for D2..  in the mean time, a number of other ideas have come up and
> have taken precedence over many things mentioned in the slides.  Some
> are already implemented, though.
> 
> > I don't know how to explain those, so I'll give an example:
> >
> > struct Foo
> > {
> >    int a;
> >    int b;
> > }
> >
> > struct Bar
> > {
> >    Foo f;
> >    real asdf;
> > }
> >
> > auto def = Bar(Foo(1, 42), 13.7);  //current
> > Bar def = {{1, 42}, 13.7};            //C-style
> >                                                 //downside: only possible if you initialize
> >                                                 //when you declare
> > auto def = Bar({1, 42}, 13.7);      //Bar for clarity, Foo obvious
> >                                        //simpler, especially with many nested structs
> 
> Better struct literals would be nice.

Better in what way? Do you like my syntax or do you have a better one?


More information about the Digitalmars-d-learn mailing list