Overloading property vs. non-property

2010-07-15 Thread dsimcha
Once property syntax is fully enforced (not necessarily recommended) will it be possible to overload properties against non-properties? My use case is that I'm thinking about API improvements for my dflplot lib and one thing that I would really like is to give a fluent interface to everything to f

Re: Overloading property vs. non-property

2010-07-15 Thread Steven Schveighoffer
On Thu, 15 Jul 2010 09:16:47 -0400, dsimcha wrote: Once property syntax is fully enforced (not necessarily recommended) will it be possible to overload properties against non-properties? My use case is that I'm thinking about API improvements for my dflplot lib and one thing that I would

Re: Overloading property vs. non-property

2010-07-15 Thread torhu
On 15.07.2010 15:16, dsimcha wrote: Once property syntax is fully enforced (not necessarily recommended) will it be possible to overload properties against non-properties? My use case is that I'm thinking about API improvements for my dflplot lib and one thing that I would really like is to give

Re: Overloading property vs. non-property

2010-07-15 Thread dsimcha
== Quote from torhu (n...@spam.invalid)'s article > In case the answer is no, that example of yours is the perfect > opportunity to dust off the almost-forgotten with statement :) > with (Histogram(someData, 10)) { > barColor = getColor(255, 0, 0); > histType = HistType.Probability; >

Re: Overloading property vs. non-property

2010-07-15 Thread torhu
On 15.07.2010 17:42, dsimcha wrote: == Quote from torhu (n...@spam.invalid)'s article In case the answer is no, that example of yours is the perfect opportunity to dust off the almost-forgotten with statement :) with (Histogram(someData, 10)) { barColor = getColor(255, 0, 0); hi

Re: Overloading property vs. non-property

2010-07-15 Thread BCS
Hello dsimcha, Histogram(someData, 10) .barColor(getColor(255, 0, 0)) .histType(HistType.Probability) .toFigure.title("A Histogram") .xLabel("Stuff").showAsMain(); With a little meta programming you might be able to make a type that generate a fluent interface for any type. Using opDispatch y

Re: Overloading property vs. non-property

2010-07-15 Thread torhu
On 16.07.2010 01:46, BCS wrote: Hello dsimcha, Histogram(someData, 10) .barColor(getColor(255, 0, 0)) .histType(HistType.Probability) .toFigure.title("A Histogram") .xLabel("Stuff").showAsMain(); With a little meta programming you might be able to make a type that generate a fluent inter

Re: Overloading property vs. non-property

2010-07-16 Thread Chad J
On 07/15/2010 09:16 AM, dsimcha wrote: > Once property syntax is fully enforced (not necessarily recommended) will it > be possible to overload properties against non-properties? My use case is > that I'm thinking about API improvements for my dflplot lib and one thing that > I would really like i

Re: Overloading property vs. non-property

2010-07-16 Thread dsimcha
== Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article > On 07/15/2010 09:16 AM, dsimcha wrote: > > Once property syntax is fully enforced (not necessarily recommended) will it > > be possible to overload properties against non-properties? My use case is > > that I'm thinking about API

Re: Overloading property vs. non-property

2010-07-16 Thread Robert Jacques
On Sat, 17 Jul 2010 00:58:58 -0400, dsimcha wrote: == Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article On 07/15/2010 09:16 AM, dsimcha wrote: > Once property syntax is fully enforced (not necessarily recommended) will it > be possible to overload properties against non-propert

Re: Overloading property vs. non-property

2010-07-16 Thread Don
Robert Jacques wrote: On Sat, 17 Jul 2010 00:58:58 -0400, dsimcha wrote: == Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article On 07/15/2010 09:16 AM, dsimcha wrote: > Once property syntax is fully enforced (not necessarily recommended) will it > be possible to overload properti

Re: Overloading property vs. non-property

2010-07-17 Thread Robert Jacques
On Sat, 17 Jul 2010 02:38:20 -0400, Don wrote: Robert Jacques wrote: On Sat, 17 Jul 2010 00:58:58 -0400, dsimcha wrote: == Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article On 07/15/2010 09:16 AM, dsimcha wrote: > Once property syntax is fully enforced (not necessarily reco

Re: Overloading property vs. non-property

2010-07-17 Thread Don
Robert Jacques wrote: On Sat, 17 Jul 2010 02:38:20 -0400, Don wrote: Robert Jacques wrote: On Sat, 17 Jul 2010 00:58:58 -0400, dsimcha wrote: == Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article On 07/15/2010 09:16 AM, dsimcha wrote: > Once property syntax is fully enforced

Re: Overloading property vs. non-property

2010-07-17 Thread Lars T. Kyllingstad
On Sat, 17 Jul 2010 10:19:51 +0200, Don wrote: > Andrei tried to avoid mentioning language features which he hoped would > change. That's why there's no mention of __traits, for example. But there is: §7.3.2, p. 275. -Lars

Re: Overloading property vs. non-property

2010-07-17 Thread Andrei Alexandrescu
Lars T. Kyllingstad wrote: On Sat, 17 Jul 2010 10:19:51 +0200, Don wrote: Andrei tried to avoid mentioning language features which he hoped would change. That's why there's no mention of __traits, for example. But there is: §7.3.2, p. 275. -Lars The enum names example was too appealing. D

Re: Overloading property vs. non-property

2010-07-17 Thread Andrei Alexandrescu
Robert Jacques wrote: Before reading TDPL I'd had agreed with you 100%. Now, I find that TDPL is either ambiguous or anticipatory in a small number of cases. For example, Functions-as-Methods get more exposure than @property, but no limitations are mentioned nor are there any generalized exampl

Re: Overloading property vs. non-property

2010-07-17 Thread Andrei Alexandrescu
dsimcha wrote: == Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article On 07/15/2010 09:16 AM, dsimcha wrote: Once property syntax is fully enforced (not necessarily recommended) will it be possible to overload properties against non-properties? My use case is that I'm thinking abou

Re: Overloading property vs. non-property

2010-07-17 Thread bearophile
Andrei Alexandrescu: > Since recently, however, Walter became very adverse to introducing > breaking changes of any kind. He understandably wants to promote > stability of the language. The only question is whether stability refers > to the compiler's status quo or TDPL. There are some holes/pr

Re: Overloading property vs. non-property

2010-07-17 Thread Robert Jacques
On Sat, 17 Jul 2010 10:34:28 -0400, Andrei Alexandrescu wrote: Robert Jacques wrote: Before reading TDPL I'd had agreed with you 100%. Now, I find that TDPL is either ambiguous or anticipatory in a small number of cases. For example, Functions-as-Methods get more exposure than @property,

Re: Overloading property vs. non-property

2010-07-17 Thread Andrei Alexandrescu
On 07/17/2010 01:14 PM, Robert Jacques wrote: I'm also hopeful for Functions-as-methods, although you may be borrowing trouble with your example. It appears that templates are not included in T.init's scope as the following compiles: struct Bar { void foo(T)() if (!is(bar.foo!int)) { writeln("re

Re: Overloading property vs. non-property

2010-07-17 Thread Jonathan M Davis
On Saturday 17 July 2010 11:14:26 Robert Jacques wrote: > As for @properties and Methods-as-properties, I know I dropped out of the > properties debate when the removal of Methods-as-properties was taken out > of the proposal. The more I use @property and see it used, the more I feel > that it's so

Re: Overloading property vs. non-property

2010-07-19 Thread Robert Jacques
On Sat, 17 Jul 2010 17:13:02 -0400, Jonathan M Davis wrote: On Saturday 17 July 2010 11:14:26 Robert Jacques wrote: As for @properties and Methods-as-properties, I know I dropped out of the properties debate when the removal of Methods-as-properties was taken out of the proposal. The more I

Re: Overloading property vs. non-property

2010-07-23 Thread Tomek Sowiński
Dnia 15-07-2010 o 22:55:04 torhu napisał(a): On 15.07.2010 17:42, dsimcha wrote: == Quote from torhu (n...@spam.invalid)'s article In case the answer is no, that example of yours is the perfect opportunity to dust off the almost-forgotten with statement :) with (Histogram(someData, 10)) {

Re: Overloading property vs. non-property

2010-07-23 Thread Tomek Sowiński
Oops, guess I should have waited until after my nap with posting :) You could nest the with statements, but then it's getting more verbose. Didn't see that. Now it's my turn for a nap :)