ライブラリ
- rss (11)
モジュール
-
RSS
:: Maker (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
ruby 1
. 6 feature (11) - tsort (11)
検索結果
-
RSS
:: Maker . make(version , &block) (21302.0) -
@todo versionには"1.0"または"0.9"または "0.91"または"2.0"を指定します."0.9" と"0.91"は同じであることに注意してください.
...@todo
versionには"1.0"または"0.9"または
"0.91"または"2.0"を指定します."0.9"
と"0.91"は同じであることに注意してください.
blockを実行したあとのmakerオブジェクトから
RSSオブジェクトを生成して返します.... -
ruby 1
. 6 feature (1116.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) ->......でした。
File.symlink("foo", "bar")
p Dir.glob("bar")
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[]
=> ruby 1.6.7 (2002-08-01) [i586-linux]
["bar"]
: 2002-06-13 Hash[]
Hash[] で、キーとなる文字列を dup & freeze していませ......:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"#"
0
=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-07-30) [i586-linux]
"\\#"
nil
: 2002-04-29: rb_find_file()... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (594.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...の変更点(まとめ)/Windows 対応>))
* ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>))
* ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>))
* ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>))
* ((<1.6.8から1.8.0......2003-06-21) [i586-linux]
以下のようにイテレータブロックと、Procをブロックとして引数で渡したと
きの挙動が同じになっています。
def foo
yield 1,2,3,4
end
foo {|a,b,c| p [a,b,c]; break }
foo( &proc {|a,b,c|......# Class.inherited メソッドの定義はなくなりました。
#
# class SubClass < Class
# end
#
# #=> -:1:in `inherited': can't make subclass of Class (TypeError)
# from -:1
# ruby 1.7.1 (2001-06-12) [i586-linux]
#
# #=> -:1: can't make subclass of... -
tsort (48.0)
-
tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
...成分に関するモジュールを提供します。
=== Example
//emlist[][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]
{......な `make' に似たツールは以下のように実装できます。
//emlist[][ruby]{
require 'tsort'
class Make
def initialize
@dep = {}
@dep.default = []
end
def rule(outputs, inputs=[], &block)
triple = [outputs, inputs, block]
outputs.each {|f| @dep[f] = [triple]}......@dep[triple] = inputs
end
def build(target)
each_strongly_connected_component_from(target) {|ns|
if ns.length != 1
fs = ns.delete_if {|n| Array === n}
raise TSort::Cyclic.new("cyclic dependencies: #{fs.join ', '}")
end
n = ns.first
if Array === n...