there can now be multiple functions with the same name. The most recently declared one will be preferred if multiple would be valid.

This commit is contained in:
mark
2023-06-04 20:07:50 +02:00
parent c2594ab6dc
commit c7642ef911
4 changed files with 201 additions and 33 deletions

View File

@@ -0,0 +1,27 @@
type person [string int]
fn name(p person/&person) p.0
fn age(p person/&person) p.1
type village [[float float] string]
fn name(v village/&village) v.1
fn location(v village/&village) v.0
fn x_coordinate(v village/&village) v.0.0
fn y_coordinate(v village/&village) v.0.1
customer := ["Max M.", 43]
home_town := [[12.3, 5.09], "Maxburg"]
debug(customer)
debug(customer.name())
debug(&customer.name())
debug(home_town)
debug(home_town.name())
debug(home_town.location())
println(
"Hello, " + customer.name()
+ " from " + home_town.name()
)