Skip to content

Commit

Permalink
* golf_prelude.rb (Array#to_s): alias to join.
Browse files Browse the repository at this point in the history
* golf_prelude.rb (FalseClass#to_s): return "".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
eban committed Jan 9, 2008
1 parent 8786b8a commit 53ac21c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Wed Jan 9 18:24:39 2008 WATANABE Hirofumi <[email protected]>

* golf_prelude.rb (Array#to_s): alias to join.

* golf_prelude.rb (FalseClass#to_s): return "".

Wed Jan 9 16:59:54 2008 Tanaka Akira <[email protected]>

* string.c (rb_enc_cr_str_buf_cat): fix self appending.
Expand Down
14 changes: 10 additions & 4 deletions golf_prelude.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ def h(a='H', b='w', c='!')
puts "#{a}ello, #{b}orld#{c}"
end

def quine(src = $0)
SCRIPT_LINES__[src].join
end

alias say puts
end

class Array
alias to_s join
end

class FalseClass
def to_s
""
end
end

class Integer
alias each times
include Enumerable
Expand Down

0 comments on commit 53ac21c

Please sign in to comment.