Scott Nimrod
Scott Nimrod

Reputation: 11595

What does the "as" keyword do in F# (OOP)?

What does the following line mean when it uses "as self" versus when it doesn't use it?

type ViewModel() as self =

Upvotes: 0

Views: 66

Answers (1)

John Palmer
John Palmer

Reputation: 25516

Using as allows you to refer to the object inside itself.

For example, calling a member function from within the constructor.

The MSDN docs go in to some more detail here https://msdn.microsoft.com/en-us/library/dd233205.aspx

Upvotes: 3

Related Questions