Thread overview | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 02, 2004 D's template-synthax | ||||
---|---|---|---|---|
| ||||
D has a different template-synthax than all other C-like languages (e.g. C++, future versions of Java and C#, nive, ...). Why? To me the more common synthax looks a lot nicer: Foo<Bar> foo; vs. Foo!(Bar) foo; |
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to der_held | <> is ambiguous to parse.. thats why c++ needs to have vector<shared_ptr<T> > instead of vector<shared_ptr<T>> for example. and it was part of the evolution of D's templated that brought it to this.. "der_held" <der_held_member@pathlink.com> schrieb im Newsbeitrag news:bvl3cu$3do$1@digitaldaemon.com... > D has a different template-synthax than all other C-like languages (e.g. C++, > future versions of Java and C#, nive, ...). Why? To me the more common synthax > looks a lot nicer: > > Foo<Bar> foo; > > vs. > > Foo!(Bar) foo; > > |
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to davepermen | What do you mean "vector<shared_ptr<T>> instead of vector<shared_ptr<T>>" please explain. And I agree, the D template syntax does suck, the C++ way is so much nicer. Oh well the rest of the languagae is nice. Just my opinion. In article <bvl3j8$3su$1@digitaldaemon.com>, davepermen says... > ><> is ambiguous to parse.. thats why c++ needs to have vector<shared_ptr<T> >> instead of vector<shared_ptr<T>> for example. > >and it was part of the evolution of D's templated that brought it to this.. > >"der_held" <der_held_member@pathlink.com> schrieb im Newsbeitrag news:bvl3cu$3do$1@digitaldaemon.com... >> D has a different template-synthax than all other C-like languages (e.g. >C++, >> future versions of Java and C#, nive, ...). Why? To me the more common >synthax >> looks a lot nicer: >> >> Foo<Bar> foo; >> >> vs. >> >> Foo!(Bar) foo; >> >> > > |
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | there's a space in the first one between the two > vector<shared_ptr<T> > works vector<shared_ptr<T>> not lets see if it works out in this post:D "imr1984" <imr1984_member@pathlink.com> schrieb im Newsbeitrag news:bvl7rq$ahc$1@digitaldaemon.com... > What do you mean "vector<shared_ptr<T>> instead of vector<shared_ptr<T>>" please > explain. > > And I agree, the D template syntax does suck, the C++ way is so much nicer. Oh > well the rest of the languagae is nice. Just my opinion. > > In article <bvl3j8$3su$1@digitaldaemon.com>, davepermen says... > > > ><> is ambiguous to parse.. thats why c++ needs to have vector<shared_ptr<T> > >> instead of vector<shared_ptr<T>> for example. > > > >and it was part of the evolution of D's templated that brought it to this.. > > > >"der_held" <der_held_member@pathlink.com> schrieb im Newsbeitrag news:bvl3cu$3do$1@digitaldaemon.com... > >> D has a different template-synthax than all other C-like languages (e.g. > >C++, > >> future versions of Java and C#, nive, ...). Why? To me the more common > >synthax > >> looks a lot nicer: > >> > >> Foo<Bar> foo; > >> > >> vs. > >> > >> Foo!(Bar) foo; > >> > >> > > > > > > |
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to davepermen | >there's a space in the first one between the two >
>
>vector<shared_ptr<T> > works
>vector<shared_ptr<T>> not
>
Java 1.5 can handle Foo<Bar<Quer>> without a whitespace between the two >>.
|
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to der_held | does java 1.5 have an overloadable operator >> ? "der_held" <der_held_member@pathlink.com> schrieb im Newsbeitrag news:bvla8p$e6n$1@digitaldaemon.com... > >there's a space in the first one between the two > > > > >vector<shared_ptr<T> > works > >vector<shared_ptr<T>> not > > > Java 1.5 can handle Foo<Bar<Quer>> without a whitespace between the two >>. > > |
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to davepermen | >does java 1.5 have an overloadable operator >> ?
Operators aren't overloadable, but there is a >> operator.
|
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to der_held | While it was 2/2/04 8:57 am throughout the UK, der_held sprinkled little black dots on a white screen, and they fell thus: > D has a different template-synthax than all other C-like languages (e.g. C++, > future versions of Java and C#, nive, ...). Why? To me the more common synthax > looks a lot nicer: > > Foo<Bar> foo; Presumably because it interferes with context-free syntax. (Foo less than bar) greater than foo.... Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit. |
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to der_held | der_held wrote:
>>there's a space in the first one between the two >
>>
>>vector<shared_ptr<T> > works
>>vector<shared_ptr<T>> not
>>
>
> Java 1.5 can handle Foo<Bar<Quer>> without a whitespace between the two >>.
>
Right, but:
Foo<Bar> baz;
looks like a template instantiation, right? What if Foo, Bar, and baz are integers? The meaning becomes TOTALLY different.
One of the overt goals of D is to be parsable without being forced to do semantic analysis at the same time. You practically have to code an entire C++ compiler if you want to parse it right.
-- andy
|
February 02, 2004 Re: D's template-synthax | ||||
---|---|---|---|---|
| ||||
Posted in reply to der_held | I like the syntax , C++'s always seemed too wordy. C "der_held" <der_held_member@pathlink.com> wrote in message news:bvl3cu$3do$1@digitaldaemon.com... > D has a different template-synthax than all other C-like languages (e.g. C++, > future versions of Java and C#, nive, ...). Why? To me the more common synthax > looks a lot nicer: > > Foo<Bar> foo; > > vs. > > Foo!(Bar) foo; > > |
Copyright © 1999-2021 by the D Language Foundation