From: Simon Krahnke Date: 2008-06-04T10:04:20+09:00 Subject: Re: Beginner help * Justin To (20:38) schrieb: > What does this mean? What did I do wrong? You are confusing blocks and procs. Every method can have a single block, which can be tested by block_given? and called by yield. Procs are Objects that have a call method. There is no special syntax for defining a method that takes a block: ,---- | def a | yield 1 | end | | a { | n | puts n } | | def b(arg) | yield 1 + arg | end | | b(1) { | n | puts n } `---- You can turn a block into a Proc: ,---- | def c(&block) | block.call 1 | end | | def d(arg, &block) | block.call(1 + arg) | end `---- That's in fact what the proc method does: ,---- | p = proc { | n | puts n } | p.call 1 `---- mfg, simon .... l