Created
May 26, 2010 14:37
-
-
Save envex/414561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chars = [*" ".."~"] | |
charlist = nil | |
chars.each do |char| | |
charlist << "#{char}," | |
end | |
puts charlist | |
#this is returning | |
#char_loop.rb:6:in `block in <main>': undefined method `<<' for nil:NilClass (NoMethodError) | |
# from char_loop.rb:5:in `each' | |
# from char_loop.rb:5:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment