mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/pp.rb (pp): return nil like p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c4af72cd46
commit
4795daf1bc
3 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Mar 26 03:23:50 2002 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
|
* lib/pp.rb (pp): return nil like p.
|
||||||
|
|
||||||
Tue Mar 26 01:48:01 2002 Akinori MUSHA <knu@iDaemons.org>
|
Tue Mar 26 01:48:01 2002 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/bigfloat/extconf.rb: Downcase the module name. (BigFloat.so
|
* ext/bigfloat/extconf.rb: Downcase the module name. (BigFloat.so
|
||||||
|
|
|
@ -55,6 +55,8 @@ I like the latter. If you do too, this library is for you.
|
||||||
: pp(obj)
|
: pp(obj)
|
||||||
output ((|obj|)) to (({$>})) in pretty printed format.
|
output ((|obj|)) to (({$>})) in pretty printed format.
|
||||||
|
|
||||||
|
It returns (({nil})).
|
||||||
|
|
||||||
== Customized output
|
== Customized output
|
||||||
To define your customized pretty printing function for your class,
|
To define your customized pretty printing function for your class,
|
||||||
redefine a method (({pretty_print(((|pp|)))})) in the class.
|
redefine a method (({pretty_print(((|pp|)))})) in the class.
|
||||||
|
@ -110,6 +112,7 @@ module Kernel
|
||||||
objs.each {|obj|
|
objs.each {|obj|
|
||||||
PP.pp(obj)
|
PP.pp(obj)
|
||||||
}
|
}
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ TSort uses Hash internally.
|
||||||
|
|
||||||
--- strongly_connected_components
|
--- strongly_connected_components
|
||||||
returns strongly connected components as an array of array of nodes.
|
returns strongly connected components as an array of array of nodes.
|
||||||
The array is sorted as children to parents.
|
The array is sorted from children to parents.
|
||||||
Each elements of the array represents a strongly connected component.
|
Each elements of the array represents a strongly connected component.
|
||||||
|
|
||||||
--- each_strongly_connected_component {|nodes| ...}
|
--- each_strongly_connected_component {|nodes| ...}
|
||||||
|
@ -114,7 +114,8 @@ Very simple `make' like tool can be implemented as follows:
|
||||||
outputs_time = nil
|
outputs_time = nil
|
||||||
end
|
end
|
||||||
if outputs_time == nil ||
|
if outputs_time == nil ||
|
||||||
inputs_time != nil && outputs_time < inputs_time # `<=' is better?
|
inputs_time != nil && outputs_time <= inputs_time
|
||||||
|
sleep 1 if inputs_time != nil && inputs_time.to_i == Time.now.to_i
|
||||||
block.call
|
block.call
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue