Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
37
Task/Inheritance-Multiple/Lasso/inheritance-multiple.lasso
Normal file
37
Task/Inheritance-Multiple/Lasso/inheritance-multiple.lasso
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
define trait_camera => trait {
|
||||
require zoomfactor
|
||||
|
||||
provide has_zoom() => {
|
||||
return .zoomfactor > 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
define trait_mobilephone => trait {
|
||||
require brand
|
||||
|
||||
provide is_smart() => {
|
||||
return .brand == 'Apple'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
define cameraphone => type {
|
||||
|
||||
trait {
|
||||
import trait_camera, trait_mobilephone
|
||||
}
|
||||
|
||||
data public zoomfactor::integer = 0,
|
||||
public brand::string
|
||||
|
||||
}
|
||||
|
||||
local(mydevice = cameraphone)
|
||||
|
||||
#mydevice -> brand = 'Apple'
|
||||
#mydevice -> zoomfactor = 0
|
||||
|
||||
#mydevice -> has_zoom
|
||||
'<br />'
|
||||
#mydevice -> is_smart
|
||||
Loading…
Add table
Add a link
Reference in a new issue