btw

what 'default' means here?

By on 9/8/2009 2:05 AM ()

If you want to have abstract members, you need to explicitly add the [<AbstractClass>] attribute (I believe that previously there was just a warning, not sure though) unless there are no implemented members. This is meant to avoid "missing" unintendedly left unimplemented abstract members.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
//will compile
type Foo =
  abstract member Run : unit -> unit

//won't compile
type Bar =
  abstract member Run : unit -> unit
  member x.SayHi() = ()

//will compile
[<AbstractClass>]
type Bar =
  abstract member Run : unit -> unit
  member x.SayHi() = ()

As for the default keyword, it means it is the default implementation in abstract classes if the children classes don't implement it.

Cheers

By on 9/8/2009 3:14 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper