mirror of
https://github.com/Dummi26/mers.git
synced 2026-01-26 10:47:04 +01:00
added arrow syntax for forcing output types and added the "any" type (which is basically useless and will likely change in the future)
This commit is contained in:
3
examples/force_output_type.mers
Normal file
3
examples/force_output_type.mers
Normal file
@@ -0,0 +1,3 @@
|
||||
fn plus(a int, b int) -> int { a + b }
|
||||
|
||||
10.plus(20).debug()
|
||||
13
examples/the_any_type.mers
Normal file
13
examples/the_any_type.mers
Normal file
@@ -0,0 +1,13 @@
|
||||
fn debug_any(val any) {
|
||||
val.debug()
|
||||
}
|
||||
|
||||
"something".debug_any()
|
||||
|
||||
fn just_return(val any) {
|
||||
val
|
||||
}.debug()
|
||||
|
||||
v := "text"
|
||||
v.debug()
|
||||
v.just_return().debug()
|
||||
Reference in New Issue
Block a user