I'm reading through the PickAxe book right now. I'm new to programming,
and more specifically, Ruby.
Right now I'm looking at a line that says this:
fib_up_to(1000) {|f| print f, ""}
I'm curious about the parts of this statement.
I know that "fib_up_to(1000)" passes 1000 into this specific method.
The thing that gets me confused is the block statement (right
terminology?). What's the "|f|"? I know "print f" says to print this
variable. Then, what're the quotes for?
Is a variable "f" created in this block, then told to print, and more
specifically, told to print into the parentheses?
I'm new, so sorry if this is a hang-up. I just want to understand.
Thank you.
···
--
Posted via http://www.ruby-forum.com/.