From: "Florian G. Pflug" Date: 2001-10-04T08:59:41+09:00 Subject: [ruby-talk:22041] Re: Marshal won't dump a Proc On Thu, Oct 04, 2001 at 05:46:08AM +0900, HarryO wrote: > Thanks to matz and Will for those explanations. The Proc I wanted to > dump/restore is a block that's provided when an instance of my class is > created. It specifies how to get the nth element of a sequence and hence > can be pretty much anything. Hence, asking the user to write it as a > string that's going to be eval-ed would make using my class a little > messy. Did you know that " %{ .... }" is a string literal in ruby? By using this, from the users point of view the only different to passing a "real" block, instead of a string, would be that he has to write a "%" before the curly brace. (and this it would act like a closure, e.g. giving you access to the surrounding variables). greetings, Florian Pflug