[前][次][番号順一覧][スレッド一覧]

ruby-changes:30933

From: eregon <ko1@a...>
Date: Sun, 22 Sep 2013 19:01:29 +0900 (JST)
Subject: [ruby-changes:30933] eregon:r43012 (trunk): * benchmark/bm_app_answer.rb: revert r42990, benchmark scripts should

eregon	2013-09-22 19:01:22 +0900 (Sun, 22 Sep 2013)

  New Revision: 43012

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43012

  Log:
    * benchmark/bm_app_answer.rb: revert r42990, benchmark scripts should
      be self-contained and avoid dependencies, especially such small one.
      See https://github.com/ruby/ruby/pull/393#issuecomment-24861301.

  Modified files:
    trunk/ChangeLog
    trunk/benchmark/bm_app_answer.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43011)
+++ ChangeLog	(revision 43012)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Sep 22 19:00:28 2013  Benoit Daloze  <eregontp@g...>
+
+	* benchmark/bm_app_answer.rb: revert r42990, benchmark scripts should
+	  be self-contained and avoid dependencies, especially such small one.
+	  See https://github.com/ruby/ruby/pull/393#issuecomment-24861301.
+
 Sat Sep 21 20:11:06 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* process.c (rb_fork_internal): remove cloexec setting on pipes
Index: benchmark/bm_app_answer.rb
===================================================================
--- benchmark/bm_app_answer.rb	(revision 43011)
+++ benchmark/bm_app_answer.rb	(revision 43012)
@@ -1,4 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_app_answer.rb#L1
-require_relative 'other-lang/ack'
+def ack(m, n)
+  if m == 0 then
+    n + 1
+  elsif n == 0 then
+    ack(m - 1, 1)
+  else
+    ack(m - 1, ack(m, n - 1))
+  end
+end
 
 def the_answer_to_life_the_universe_and_everything
   (ack(3,7).to_s.split(//).inject(0){|s,x| s+x.to_i}.to_s + "2" ).to_i

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]