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
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
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
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
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
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
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
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
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
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,
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)
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
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,
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
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:
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
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 :)
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,
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
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
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
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
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
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
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
There are unconfirmed reports that this morning, the C++0x standards
group in Frankfurt voted to kill Concepts.
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.
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
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:
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)
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,
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)
32 matches
Mail list logo