Hah people bringing up the argument "bad syntax", when they got nothing to
say!
Like they type "Matrix!(double, 5, 5)" every time they use a matrix
no you never do that, you just:
alias Matrix!(double, 5, 5) mat5; // sweet isn't it? Remember! it is a
type!
On Sat, 06 Nov 2010 12:27:34 +0200, Simen kjaeraas
<[email protected]> wrote:
bearophile <[email protected]> wrote:
Simen kjaeraas:
Not sure. This way is more explicit, and errors will be caught at
compile-time.
I see. But if a syntax is ugly and too much heavy, people (rightly)
don't use it... (This is why bounded values are good as builtins).
Of course. Now, aliases help a bit here, turning that into something
like:
alias Bounded!(int, 1, 5) myInt;
myInt[] myArr;
myArr ~= myInt( 1 );
I believe using an alias would be a good idea in most such cases, as
one's bound to write Bounded!(int,1,6) in a long program, and
wonder why it doesn't compile.
--
Using Opera's revolutionary email client: http://www.opera.com/mail/