feat(lang): bind a port member that takes nothing to a variable
bind Purse { money: g_money } writes the getter bind_Purse_money in the
bind's own file, so a one-line wrapper per member is not needed; a
member that takes something is refused a variable. Reseed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7b8c134c21
commit
7ef6c7ec75
8 changed files with 45376 additions and 44711 deletions
9
examples/rejected/port_var_args.ludic
Normal file
9
examples/rejected/port_var_args.ludic
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# L3: a variable answers a member that takes nothing; price takes an int, so it binds a function
|
||||
program PortVarArgs {
|
||||
port Purse { price: fn(int) -> int }
|
||||
var g_rate: int = 3
|
||||
bind Purse { price: g_rate }
|
||||
entry {
|
||||
print(Purse.price(2))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue