I’m fairly need to this whole F# thing and Functional programming.. I’ve been looking in all possible documents and found nothing, so therefore I ask you for help for my simple problem. How do I declare:
public myClass test;
in F#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want the declaration to go in the module, do
If you want the declaration to go in the class, do
You’ll have to initialize test in the constructor, or to provide a DefaultValue attribute:
Then it will be default-initialized to
null.The final alternative is to have the private field (then you can initialize it inside the class declaration) and provide an accessor:
or