Ranges

superdan super at dan.org
Fri Jun 19 19:18:14 PDT 2009


Yigal Chripun Wrote:

> Lutger wrote:
> > Yigal Chripun wrote:
> > ...
> >> IMHO, duck-typing in D is a tragic mistake...  This should have been
> >> implemented with compile time interfaces.
> > 
> > Care to provide arguments?
> > 
> > 
> 
> duck typing makes more sense in dynamic languages like Ruby which is 
> famous for it.

yer didnt say why & this adds nutt'n'.

> in static languages I as a user prefer to trade flexibility due to 
> duck-typing for compile time checks.

yer dunno what yer talking about do ya. d checks duck typed shit at compile time.

> yes, at compile time, duck typing and (compile-time) interfaces are 
> basically the same thing, but since the rest of the language uses formal 
> interfaces, it is more consistent (and easier to understand) to use the 
> same approach at compile-time as well. point in case, look how much 
> unnecessary confusion Ranges cause which would be eliminated had D 
> allowed for compile-time interfaces.
> i.e.
> Interface I { .. }
> struct S : I { ... }
> this is basically the same as C++ concepts only without redundant and 
> confusing syntax.

& how do ya figure tat I defines a type elementtype?

> templates are hard for users to understand and one of the main reasons 
> for this is that templates are essentially a completely different 
> language with different syntax and semantics which to me looks like 
> mis-design.

2 me looks like yer in way over yer head.



More information about the Digitalmars-d mailing list