Hi people, I'm trying to wrap function definitions, and cannot find a way to refer to a block from inside the code I generate and subsequently pass to class_eval: ,---- |class Module | def fdef name, &block | code = <<-EOC | def #{name} | # somehow yield to block #{block} <------ | end | EOC | class_eval code | end |end | |class Foo | fdef("bar") { puts "bar!" } |end | |Foo.new.bar # => expecting "bar!" `---- What am I missing here? Something completely different: the manual claims that the construct <<-EOF strips all leading whitespace from the here document. It doesn't... (ruby 1.6.1 (2000-09-27) [i686-linux]) Many thanks to Dave and Andy for the pickaxe book, I finally received it from amazon this weekend (after *4* weeks...) and it has been (and still is) a joy to read. Thanks guys! Michel