piranha gtv test irb1 irb main 001 def fac irb main 002 if irb main 00

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
piranha@gtv ~/test>irb1.9
irb(main):001:0> def fac i
irb(main):002:1> if i == 1
irb(main):003:2> return i
irb(main):004:2> else
irb(main):005:2* return i * fac(i)
irb(main):006:2> end
irb(main):007:1> end
=> nil
irb(main):008:0> fac 22
SystemStackError: stack level too deep
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
... 6845 levels...
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):5:in `fac'
from (irb):8
from /usr/bin/irb1.9:12:in `<main>'irb(main):009:0>