demo
blockallHST
comment:HST
params:HST
scope:HST
1 namespace demo
2 scope:...
3
4 class Person scope:...
5
6 field name : str #:...
7 The name of the person.
8 field height : double #:...
9 Height of person in meters.
10 field weight : double #:...
11 Weight of person in kilograms.
12
13 lifecycle params:...
14 var name : str #:...
15 The name of the person.
16 var height -> height;
17 var weight -> weight;
18 scope:...
19 self.nameIs(name)
20
21 method bodyMassIndex : double #:...
22 Compute the BMI for this person.
23 scope:...
24 height = self.height()
25 return self.weight() / (height * height)
26
27 ;