cody <no****************@gmx.net> wrote:
See http://www.pobox.com/~skeet/csharp/constructors.html for more
information.
I've never understood why this special syntax is used here. Why not do it
like java and allow base(param);?
This would give you the freedom to do parameter processing before calling
the base ctor or you could do a try{}catch around the base()-call in future
versions of c#.
Just having the Java syntax wouldn't allow that - Java doesn't allow
anything else to happen before the constructor is called either.
For parameter processing, the normal approach is to write a static
method which massages the parameters appropriately, and use
public Foo(int x) : base (Massage(x))
{
....
}
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too