Property discussion wrap-up

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 29 22:44:06 PST 2013


On Wed, Jan 30, 2013 at 06:24:56AM +0100, Zach the Mystic wrote:
> On Wednesday, 30 January 2013 at 05:20:51 UTC, Zach the Mystic
> wrote:
> >You know, I was too dumb to even understand what you wrote when I
> >read it the first time. I was just naively assuming that nested
> >structs were like nested functions. Some rules definitely need to
> >be figured out here. I don't see why the basic functionality which
> >is provided for nested functions couldn't work also for nested
> >structs. Does "static struct" mean anything here? Couldn't it be
> >used exactly like static nested functions? Would it break code if
> >we now forced people to say "static struct" instead of just
> >struct?
> >
> >I'm sorry for missing your point. I'm trying to suggest advanced
> >language features without even knowing some of the basics. I ask
> >you to bear with me.
> 
> Wait, hold on there! This says otherwise:
> http://dlang.org/struct.html
> 
> So what's up? Who's wrong!?

That page only states the structs nested inside *functions* have a
context pointer to the function's local variables. It says nothing about
structs nested inside *structs*. (And yes, I looked. I was actually in
the middle of writing something about using structs to simulate
properties, and decided to look it up to be sure, and found that the
spec actually doesn't say what I thought it said.)


T

-- 
Help a man when he is in trouble and he will remember you when he is in trouble again.


More information about the Digitalmars-d mailing list