On Fri, Jul 11, 2008 at 10:20 AM, Karl von Laudermann
<doodpants / mailinator.com> wrote:
> On Jul 11, 1:11 pm, Martin DeMello <martindeme... / gmail.com> wrote:
>> Therefore your code should be:
>>
>>  def myblock
>>     testvar = ['cool', 'array']
>>     testvar = yield testvar
>>     print testvar
>>  end
>>
>>   myblock do |stuff|
>>     return "dumb string"
>>   end
>
> I was going to post a response similar to yours but you beat me to it.
> However, I tried your version, and the return statement is causing an
> error. You instead just want to do:
>
> myblock do |stuff|
>  "dumb string"
> end

oops, yes - that'll teach me to type code straight into email. been
doing too much javascript of late!

martin