Find limit of recursion: Difference between revisions

(→‎{{header|Delphi}}: Adds Déjà Vu example)
Line 1,486:
 
=={{header|Rust}}==
Rust 0.8:
<lang rust>fn recurse(n: int) {
println(fmt!("deep: %?", n));
Line 1,494 ⟶ 1,495:
recurse(0);
}</lang>
Run:
Rust 0.8:
<pre>deep: 7892...
deep: 7892
Segmentation fault</pre>
 
Rust 0.9:
<lang rust>fn recurse(n: int) {
println!("deep: {:d}", n);
recurse(n + 1);
}
 
fn main() {
recurse(0);
}</lang>
Run:
<pre>...
deep: 12952
 
 
There are not many persons who know what wonders are opened to them in the
stories and visions of their youth; for when as children we listen and dream,
we think but half-formed thoughts, and when as men we try to remember, we are
dulled and prosaic with the poison of life. But some of us awake in the night
with strange phantasms of enchanted hills and gardens, of fountains that sing
in the sun, of golden cliffs overhanging murmuring seas, of plains that stretch
down to sleeping cities of bronze and stone, and of shadowy companies of heroes
that ride caparisoned white horses along the edges of thick forests; and then
we know that we have looked back through the ivory gates into that world of
wonder which was ours before we were wise and unhappy.
 
fatal runtime error: assertion failed: !ptr.is_null()
Aborted
</pre>
 
=={{header|Sather}}==
Anonymous user