samples.categories.methods.operator.pec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of WebSite Show documentation
Show all versions of WebSite Show documentation
Prompto Documentation Web Site POM
define currency as Text attribute matching "[A-Z]{3}"
define value as Decimal attribute
define Amount as category with attributes currency and value, and methods:
define + as operator receiving Amount other doing:
return Amount with currency as currency and value + other.value as value
define main as method doing:
a = Amount with "USD" as currency and 2000.0 as value
b = Amount with "USD" as currency and 4000.0 as value
printLine "a + b -> " + (a + b)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy