Jump to page: 1 2 3
Thread overview
D's template-synthax
Feb 02, 2004
der_held
Feb 02, 2004
davepermen
Feb 02, 2004
imr1984
Feb 02, 2004
davepermen
Feb 02, 2004
der_held
Feb 02, 2004
davepermen
Feb 02, 2004
Matthias Becker
Feb 02, 2004
Andy Friesen
Feb 09, 2004
Walter
Feb 10, 2004
davepermen
Feb 10, 2004
davepermen
Feb 10, 2004
Stewart Gordon
Feb 13, 2004
Walter
Feb 13, 2004
davepermen
Feb 13, 2004
Sean Kelly
Feb 13, 2004
davepermen
Feb 13, 2004
Sean Kelly
Feb 15, 2004
davepermen
Feb 16, 2004
Derek Parnell
Feb 13, 2004
Sean Kelly
Feb 13, 2004
Andy Friesen
Feb 17, 2004
Juanjo Álvarez
Feb 02, 2004
Stewart Gordon
Feb 02, 2004
C
February 02, 2004
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
<> 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
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
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
>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
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
>does java 1.5 have an overloadable operator >> ?

Operators aren't overloadable, but there is a >> operator.


February 02, 2004
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
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
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;
>
>


« First   ‹ Prev
1 2 3