@@ -5,7 +5,6 @@ <h2>Comments</h2>
55
66< h2 > Strings</ h2 >
77< pre > < code > "foo \"bar\" baz"
8- 'foo \'bar\' baz'
98@"Verbatim strings"
109"""Alternate "verbatim" strings"""
1110</ code > </ pre >
@@ -58,32 +57,32 @@ <h2>Numbers</h2>
5857</ code > </ pre >
5958
6059< h2 > Full example</ h2 >
61- < pre > < code > // The declaration creates a constructor that takes two values, name and age.
60+ < pre > < code > // The declaration creates a constructor that takes two values, name and age.
6261type Person(name:string, age:int) =
63- // A Person object's age can be changed. The mutable keyword in the
64- // declaration makes that possible.
62+ // A Person object's age can be changed. The mutable keyword in the
63+ // declaration makes that possible.
6564 let mutable internalAge = age
6665
67- // Declare a second constructor that takes only one argument, a name.
68- // This constructor calls the constructor that requires two arguments,
69- // sending 0 as the value for age.
66+ // Declare a second constructor that takes only one argument, a name.
67+ // This constructor calls the constructor that requires two arguments,
68+ // sending 0 as the value for age.
7069 new(name:string) = Person(name, 0)
7170
72- // A read-only property.
71+ // A read-only property.
7372 member this.Name = name
74- // A read/write property.
73+ // A read/write property.
7574 member this.Age
7675 with get() = internalAge
7776 and set(value) = internalAge <- value
7877
79- // Instance methods.
80- // Increment the person's age.
78+ // Instance methods.
79+ // Increment the person's age.
8180 member this.HasABirthday () = internalAge <- internalAge + 1
8281
83- // Check current age against some threshold.
82+ // Check current age against some threshold.
8483 member this.IsOfAge targetAge = internalAge >= targetAge
8584
86- // Display the person's name and age.
87- override this.ToString () =
85+ // Display the person's name and age.
86+ override this.ToString () =
8887 "Name: " + name + "\n" + "Age: " + (string)internalAge
89- </ code > </ pre >
88+ </ code > </ pre >
0 commit comments