Re: C++0x Concepts - Dead?

2009-07-18 Thread Charles Hixson
Walter Bright wrote: aarti_pl wrote: Walter Bright pisze: aarti_pl wrote: My proposal would make meta programing in D much more intuitive (because of using rules - not bunch of corner cases as it is today). Unfortunately almost no one from NG commented on that... Thank you, but I don't see

Re: C++0x Concepts - Dead?

2009-07-17 Thread Witold Baryluk
Dnia 2009-07-17, piÄ… o godzinie 02:32 +0200, BLS pisze: bearophile wrote: BLS: bearophile brings in several times Scala/OCAML like pattern matching. Why not using that for constraints ? I have no idea how that works, though Bartosz has been looking into it. O well, I am pretty sure

Re: C++0x Concepts - Dead?

2009-07-16 Thread BLS
Walter Bright wrote: Christian Kamm wrote: Christian Kamm wrote: Is there a difference between template Foo(T : U) {} and template Foo(T) if(is(T : U)) {} ? Walter Bright wrote: Yes. Constraints determine the list of candidate template declarations, but do not participate in the partial

Re: C++0x Concepts - Dead?

2009-07-16 Thread BCS
Reply to Nick, Hmm, but I guess it does allow match/not-match to be determined by arbitrary compile-time expressions. Is there another benefit to the constraints that I'm missing? Not that I know of (but that says very little :). It might be a good rule of thumb to never directly use the

Re: C++0x Concepts - Dead?

2009-07-16 Thread Walter Bright
BLS wrote: The current Template specialization implementation is doing a best fit search anyway, so why constraints are not able to use the same mechanism. ? The template specialization method is based on types - but there's no way to look inside those types and specialize based on properties

Re: C++0x Concepts - Dead?

2009-07-16 Thread BCS
Reply to Jarrett, I was thinking it'd be more intuitive if constraints - which are more general - would be used to implement specialization. That is, template X(T: A, U: B) would basically be syntactic sugar for template X(T) if(is(T: A) is(U: B)) Then you have only a single system of

Re: C++0x Concepts - Dead?

2009-07-16 Thread Walter Bright
aarti_pl wrote: My proposal would make meta programing in D much more intuitive (because of using rules - not bunch of corner cases as it is today). Unfortunately almost no one from NG commented on that... Thank you, but I don't see in your proposal a method that can: 1. instantiate

Re: C++0x Concepts - Dead?

2009-07-16 Thread Walter Bright
Ary Borenszweig wrote: Suppose you implement partial ordering with template constraints and drop the others. What things you couldn't do? (I need an example because I can't see it). How could I do partial ordering if one constraint expression accepts only odd integers? Remember that partial

Re: C++0x Concepts - Dead?

2009-07-16 Thread Jarrett Billingsley
On Thu, Jul 16, 2009 at 5:03 PM, Walter Brightnewshou...@digitalmars.com wrote: Jarrett Billingsley wrote: Let's try to *simplify* metaprogramming and make things *orthogonal* instead of tacking on features with no regard to the existing ones. Type matching cannot do what expression matching

Re: C++0x Concepts - Dead?

2009-07-16 Thread aarti_pl
Walter Bright pisze: aarti_pl wrote: How would you do currently in D? template (T) if (T.init + T.init) { } in D1.0 template(T if typeof(T.init + T.init) == T) or in D2.0 template(T if __traits(compiles, T.init + T.init)) I could mess something in above examples, but as you can see,

Re: C++0x Concepts - Dead?

2009-07-16 Thread BCS
Reply to Walter, How could I do partial ordering if one constraint expression accepts only odd integers? you wouldn't, but rather ignore that clause and mine the constraints that you would use out of the expression (see my post for details)

Re: C++0x Concepts - Dead?

2009-07-16 Thread Walter Bright
aarti_pl wrote: Walter Bright pisze: aarti_pl wrote: How would you do currently in D? template (T) if (T.init + T.init) { } in D1.0 template(T if typeof(T.init + T.init) == T) D1 is closed to such enhancements, in any case, the ==T part is wrong. byte+byte==int, for example. or in

Re: C++0x Concepts - Dead?

2009-07-16 Thread Walter Bright
BCS wrote: Reply to Walter, How could I do partial ordering if one constraint expression accepts only odd integers? you wouldn't, but rather ignore that clause and mine the constraints that you would use out of the expression (see my post for details) Then aren't things getting just as,

Re: C++0x Concepts - Dead?

2009-07-16 Thread Walter Bright
BLS wrote: Thanks for taking the time to answer ; But the question remains the same : _Why_ ? Constraints /have/ to use a completely different approach ? (more intuitive than is not ..ahem.. is not a good enough reason) I think it is a very good reason. Of course, we can argue about if it is

Re: C++0x Concepts - Dead?

2009-07-16 Thread aarti_pl
BCS pisze: Reply to Aarti_pl, template(T if typeof(T.init + T.init) == T) who ever said T + T == T? What if that is not needed? That is the only way to do it in D1 AFAIK. In D2 you have __traits(compile, ). But before you get into discussion, please read my point made to Walter:

Re: C++0x Concepts - Dead?

2009-07-16 Thread BCS
Reply to Walter, BCS wrote: Reply to Walter, How could I do partial ordering if one constraint expression accepts only odd integers? you wouldn't, but rather ignore that clause and mine the constraints that you would use out of the expression (see my post for details) Then aren't things

Re: C++0x Concepts - Dead?

2009-07-16 Thread bearophile
BLS: bearophile brings in several times Scala/OCAML like pattern matching. Why not using that for constraints ? I have no idea how that works, though Bartosz has been looking into it. O well, I am pretty sure that bearophile is willing to give you any information you need :)

Re: C++0x Concepts - Dead?

2009-07-16 Thread aarti_pl
Walter Bright pisze: aarti_pl wrote: Walter Bright pisze: aarti_pl wrote: How would you do currently in D? template (T) if (T.init + T.init) { } in D1.0 template(T if typeof(T.init + T.init) == T) D1 is closed to such enhancements, in any case, the ==T part is wrong. byte+byte==int,

Re: C++0x Concepts - Dead?

2009-07-16 Thread BLS
bearophile wrote: BLS: bearophile brings in several times Scala/OCAML like pattern matching. Why not using that for constraints ? I have no idea how that works, though Bartosz has been looking into it. O well, I am pretty sure that bearophile is willing to give you any information you need

Re: C++0x Concepts - Dead?

2009-07-16 Thread BLS
Walter Bright wrote: BLS wrote: Walter Bright wrote: BLS wrote: (more intuitive than is not ..ahem.. is not a good enough reason) I think it is a very good reason. Of course, we can argue about if it is actually intuitive or not. ok. but that's only eye candy, no ? I once drove a

Re: C++0x Concepts - Dead?

2009-07-15 Thread BLS
Christian Kamm wrote: BLS Wrote: I have somehow the idea that D constraints and template specialization should merge. I also feel that specialization may just be a special case of constraints - with the added benefit that implicit function template instantiation works. will see what Walter

Re: C++0x Concepts - Dead?

2009-07-15 Thread bearophile
Christian Kamm: Is there a difference between template Foo(T : U) {} and template Foo(T) if(is(T : U)) {} ? I think if() offers better error messages here (I have not tried it in this case, so I may be wrong). Even if I am right, it's not inevitable, GCC shows to give better error messages

Re: C++0x Concepts - Dead?

2009-07-15 Thread Walter Bright
Christian Kamm wrote: BLS Wrote: I have somehow the idea that D constraints and template specialization should merge. I also feel that specialization may just be a special case of constraints - with the added benefit that implicit function template instantiation works. Is there a difference

Re: C++0x Concepts - Dead?

2009-07-14 Thread Christian Kamm
Walter Bright Wrote: There are unconfirmed reports that this morning, the C++0x standards group in Frankfurt voted to kill Concepts. This seems to be the relevant pre-Frankfurt text: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2893.pdf I doubt concepts are 'dead' - from the

Re: C++0x Concepts - Dead?

2009-07-14 Thread bearophile
Christian Kamm: This seems to be the relevant pre-Frankfurt text: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2893.pdf C++ as a language has competition -- from high-level runtimes such as JavaScript, .NET etc; from hardware such as graphics accelerators; and from C and Objective

C++0x Concepts - Dead?

2009-07-13 Thread Walter Bright
There are unconfirmed reports that this morning, the C++0x standards group in Frankfurt voted to kill Concepts.

Re: C++0x Concepts - Dead?

2009-07-13 Thread Jarrett Billingsley
On Mon, Jul 13, 2009 at 5:33 PM, Walter Brightnewshou...@digitalmars.com wrote: There are unconfirmed reports that this morning, the C++0x standards group in Frankfurt voted to kill Concepts. Oh, wow.

Re: C++0x Concepts - Dead?

2009-07-13 Thread Jarrett Billingsley
On Mon, Jul 13, 2009 at 5:46 PM, Jarrett Billingsleyjarrett.billings...@gmail.com wrote: On Mon, Jul 13, 2009 at 5:33 PM, Walter Brightnewshou...@digitalmars.com wrote: There are unconfirmed reports that this morning, the C++0x standards group in Frankfurt voted to kill Concepts. Oh, wow. I

Re: C++0x Concepts - Dead?

2009-07-13 Thread Jarrett Billingsley
On Mon, Jul 13, 2009 at 5:59 PM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Jarrett Billingsley wrote: On Mon, Jul 13, 2009 at 5:46 PM, Jarrett Billingsleyjarrett.billings...@gmail.com wrote: On Mon, Jul 13, 2009 at 5:33 PM, Walter Brightnewshou...@digitalmars.com wrote:

Re: C++0x Concepts - Dead?

2009-07-13 Thread BLS
Walter Bright wrote: There are unconfirmed reports that this morning, the C++0x standards group in Frankfurt voted to kill Concepts. Who cares. Or, in other words ; do you consider D constraints as can't life without feature ? (no offense.. just think it's not that remarkable)

Re: C++0x Concepts - Dead?

2009-07-13 Thread Robert Fraser
Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Mon, Jul 13, 2009 at 5:59 PM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Jarrett Billingsley wrote: On Mon, Jul 13, 2009 at 5:46 PM, Jarrett Billingsleyjarrett.billings...@gmail.com wrote: On Mon, Jul 13, 2009 at 5:33 PM,

Re: C++0x Concepts - Dead?

2009-07-13 Thread Walter Bright
BLS wrote: Walter Bright wrote: There are unconfirmed reports that this morning, the C++0x standards group in Frankfurt voted to kill Concepts. Who cares. Or, in other words ; do you consider D constraints as can't life without feature ? (no offense.. just think it's not that remarkable)