As it stands, 'new' behaves like an operator (behaves like, but is really a grammar artifact) and so is consistent with intuition. How would we make something like 'int[][].new( 5, 10 )' make sense *without* having to provide a function (presumably through UFCS) for each arity? And, given the design of D arrays, what would such a function even look like?
Before we go proposing something like replacing 'new Foo( val )'
with 'Foo.new( val )' ... which is just so Ruby-esque, but that's
okay with me ... we need to consider that 'new' is not used only
for classes. Okay, so presumably structs would work the same
way, but what of, say, arrays? What would be the equivalent of
'new int[][]( 5, 10 )' given such a change?
- Re: Consistency, Templates, Constructors, and D3 Nathan M. Swan
- Re: Consistency, Templates, Constructors, and D... Andrej Mitrovic
- Re: Consistency, Templates, Constructors, and D... David Nadlinger
- Re: Consistency, Templates, Constructors, and D... F i L
- Re: Consistency, Templates, Constructors, and D3 David Piepgrass
- Re: Consistency, Templates, Constructors, and D... Nick Treleaven
- Re: Consistency, Templates, Constructors, a... David Piepgrass
- Re: Consistency, Templates, Constructor... Nick Treleaven
- Re: Consistency, Templates, Constructors, and D... David Piepgrass
- Re: Consistency, Templates, Constructors, and D3 Tommi
- Re: Consistency, Templates, Constructors, and D3 Chris Nicholson-Sauls
- Re: Consistency, Templates, Constructors, and D... F i L
- Re: Consistency, Templates, Constructors, a... Era Scarecrow
- Re: Consistency, Templates, Constructor... F i L
- Re: Consistency, Templates, Constru... Era Scarecrow
- Re: Consistency, Templates, Co... foobar
- Re: Consistency, Templates, Co... F i L
- Re: Consistency, Templates... Era Scarecrow
- Re: Consistency, Templates... Jose Armando Garcia