9 lines
272 B
Text
9 lines
272 B
Text
# L3: a state's field answers a member that takes nothing; price takes an int, so it binds a function
|
|
program PortVarArgs {
|
|
port Purse { price: fn(int) -> int }
|
|
state Rates { rate: int = 3 }
|
|
bind Purse { price: Rates.rate }
|
|
entry {
|
|
print(Purse.price(2))
|
|
}
|
|
}
|