Re: It's awfully quiet

2009-08-17 Thread Zhenyu Zhou
Paul D. Anderson Wrote: > It's awfully quiet on the newsgroup today. Does that mean Walter is busy > getting the new release ready? > Or does it only mean I'm not getting new posts :( > Suspiciously, > > Paul http://erdani.org/ Andrei sustains his dissertation defense today. Maybe Walter is a

Re: Exponential operator

2009-08-11 Thread Zhenyu Zhou
Don Wrote: > However, the syntax is really not the issue. The issue is, is there > sufficient need for a power operator (of any syntax)? std.math.pow only support floating point number http://d.puremagic.com/issues/show_bug.cgi?id=2973 If we can't make the power function more powerful, yes, we n

Re: property syntax strawman

2009-08-02 Thread Zhenyu Zhou
Walter Bright Wrote: > One way is to simply add a "property" attribute keyword: > >property bool empty() { ... } >property void empty(bool b) { ... } > > The problem is that: > > 1. there are a lot of keywords already > 2. keywords are global things Have you thought about reusing existi

Re: property syntax strawman

2009-08-02 Thread Zhenyu Zhou
Walter Bright Wrote: > but oops! That defines a field. So we came up with essentially a hack: > >bool empty{} weird syntax I'd rather use bool empty=() { ... } void empty=(bool b) { ... }

Re: Properties: a.b.c = 3

2009-07-29 Thread Zhenyu Zhou
Chad J Wrote: > Zhenyu Zhou wrote: > > > > What about: > > > > class Widget > > { > > Rectangle _rect; > > immutable(Rectangle) rect() const { return _rect; } > > Rectangle rect(Rectangle r) { return _rect = r; } > > } >

Re: Properties: a.b.c = 3

2009-07-29 Thread Zhenyu Zhou
Chad J Wrote: > Currently there are some cases where the current paradigm forces you to > do that kind of work by hand: > > struct Rectangle > { > float x,y,w,h; > } > class Widget > { > Rectangle _rect; > Rectangle rect() { return _rect; } > Rectangle rect(Rectangle r) { r

Re: Properties: a.b.c = 3

2009-07-29 Thread Zhenyu Zhou
Daniel Keep Wrote: > Maybe the compiler could rewrite the above as: > > auto t = a.b; > t.c = 3; > a.b = t; > > Unless it can prove it doesn't need to. Same solution as to the op= > conundrum. I think b should be const if it is a temporary object. And the compiler will tell you that a.b.c is