diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-27 01:46:05 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-27 01:46:05 +0000 |
| commit | dbb7003a54e37fb5f76a0a0d58a4872a49ae3408 (patch) | |
| tree | 26b84c3f962f892c2a08e022e45342a72b37a725 /lib/prettyprint.rb | |
| parent | ae2a01bedca526b5b2e7a84ca5e8606970a47ce5 (diff) | |
| download | ruby-dbb7003a54e37fb5f76a0a0d58a4872a49ae3408.tar.gz ruby-dbb7003a54e37fb5f76a0a0d58a4872a49ae3408.tar.xz ruby-dbb7003a54e37fb5f76a0a0d58a4872a49ae3408.zip | |
* (lib/pp.rb, lib/prettyprint.rb): define seplist in PP::PPMethods
instead of PrettyPrint.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/prettyprint.rb')
| -rw-r--r-- | lib/prettyprint.rb | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb index 25e24f661..7b38cc011 100644 --- a/lib/prettyprint.rb +++ b/lib/prettyprint.rb @@ -94,32 +94,6 @@ non-string formatting, etc. --- flush outputs buffered data. ---- seplist(list[, separator_proc[, iter_method]]) {|elt| ... } - adds a separated list. - The list is separated by comma with breakable space, by default. - - seplist iterates the ((|list|)) using ((|iter_method|)). - It yields each object to the block given for seplist. - The procedure ((|separator_proc|)) is called between each yields. - - If the iteration is zero times, ((|separator_proc|)) is not called at all. - - If ((|separator_proc|)) is nil or not given, - (({lambda { comma_breakable }})) is used. - If ((|iter_method|)) is not given, (({:each})) is used. - - For example, following 3 code fragments has similar effect. - - q.seplist([1,2,3]) {|v| xxx v } - - q.seplist([1,2,3], lambda { comma_breakable }, :each) {|v| xxx v } - - xxx 1 - q.comma_breakable - xxx 2 - q.comma_breakable - xxx 3 - --- first? first? is obsoleted at 1.8.2. @@ -187,19 +161,6 @@ class PrettyPrint @group_stack.last end - def seplist(list, sep=nil, iter_method=:each) - sep ||= lambda { comma_breakable } - first = true - list.__send__(iter_method) {|*v| - if first - first = false - else - sep.call - end - yield(*v) - } - end - def first? warn "PrettyPrint#first? is obsoleted at 1.8.2." current_group.first? |
