2022-09-09から1日間の記事一覧
rubykaigi.org を見ました。 良い機会なのでruby/debugを素振りしてみます。 次のRubyスクリプトを書きます。 require 'debug' def baz n n end def bar n baz n end def foo n bar n end binding.b result = foo(100) p result 実行してみましょう。 ledsun…
sumim.hatenablog.com の追試です。 複数のRuby実装で速さの違いを比べてみます。 スクリプト require 'benchmark' def tak(x, y, z) if x > y then tak(tak(x-1, y, z), tak(y-1, z, x), tak(z-1, x, y)) else y end end Benchmark.bm do |x| x.report do t…
rbevnとruby-buildを使ってRuby 3.2.0-preview2をインストールします。 ledsun@MSI:~►rbenv install 3.2.0-preview2 To follow progress, use 'tail -f /tmp/ruby-build.20220909111902.4631.log' or pass --verbose Downloading ruby-3.2.0-preview2.tar.gz…