=begin
dave[RUBY3/Book 18:11:11*] cat t.rb
require 'profile'
def ackerman(m, n)
if m == 0 then n+1
elsif n == 0 and m > 0 then ackerman(m-1, 1)
else ackerman(m-1, ackerman(m, n-1))
end
end
ackerman(3, 3)
=begin
I don't know if this is related, but it you add a @puts@, you get a different error...
dave[RUBY3/Book 18:13:48*] cat /tmp/prog.rb
require 'profile'
puts "\footnotesize" # <<< added this line
def ackerman(m, n)
if m == 0
n+1
elsif n == 0 and m > 0
ackerman(m-1, 1)
else
ackerman(m-1, ackerman(m, n-1))
end
end
ackerman(3, 3)
dave[RUBY3/Book 18:14:03*] ruby /tmp/prog.rb
% cumulative self self total
time seconds seconds calls ms/call ms/call name
0.00 0.01 0.00 1 0.00 10.00 #toplevel
/tmp/prog.rb:2:in puts': Can't create Binding Object on top of Fiber. (RuntimeError) from /tmp/prog.rb:2:in puts'
from /tmp/prog.rb:2:in `'
Author: Dave Thomas
Status: Open
Priority: Normal
Assigned to:
Category:
Target version:
dave[RUBY3/Book 18:11:11*] cat t.rb
require 'profile'
def ackerman(m, n)
if m == 0 then n+1
elsif n == 0 and m > 0 then ackerman(m-1, 1)
else ackerman(m-1, ackerman(m, n-1))
end
end
ackerman(3, 3)
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account
=begin
[Dave Thomas wrote:] Should I document this as a workaround when I talk about profiling, or will it be fixed before 1.9 goes final?
[SASADA Koichi wrote:] This is "1.9" feaure. At least, Matz accept it. I'm not sure that it should be written.
But the profile library is distributed with 1.9, and it doesn't work because of this change. I think that counts as a bug, not a feature. If it isn't a bug in the interpreter, then surely the library has to be adapted to work or removed from the standard distribution.
=end
But the profile library is distributed with 1.9, and it doesn't work because of this change. I think that counts as a bug, not a feature. If it isn't a bug in the interpreter, then surely the library has to be adapted to work or removed from the standard distribution.
I have misunderstood. I thought your point is "Fixnum#+ is not
appeared". But your point is "There isn't Object#ackerman on a
profile result", isn't it?