Content deleted Content added
Added more secondary sources and more example code. |
m syntaxhighlight lang="gleam" for Pygments 2.18 upgrade |
||
Line 40:
== Example ==
<syntaxhighlight lang="gleam">
import gleam/io
Line 46:
io.println("hello, friend!")
}
</syntaxhighlight>
Gleam supports [[tail call]] optimization:<ref>{{cite web | url=https://tour.gleam.run/flow-control/tail-calls/ | title=Tail Calls | website=The Gleam Language Tour | access-date=26 March 2024}}</ref>
<syntaxhighlight lang="gleam">
pub fn factorial(x: Int) -> Int {
// The public function calls the private tail recursive function
Line 63:
}
}
</syntaxhighlight>
== References ==
|