by heavensteeth · 4w ago · 0 comments
There's already another syntax example in the thread, but I want to point out the weirdest syntax I've seen yet: positional arguments look like posix command arguments:
greet name/string="World" --greeting/string="Hello" -> string:
return "$greeting $name"
main:
print (greet) // Prints Hello World.
print (greet "Ada" --greeting="Hi") // Prints Hi Ada.https://docs.toit.io/language/beginner/lists-and-functions/#...
The name argument is positional here.
Then again, nowadays, it’s not like you have to write code yourself.