title: Need a class that can generate other classes from a block
body: <p>The question is kind of hard to word, but here's the idea. I want to be able to do something like this:</p>
  
  <pre><code>A=M.make {|x| x+1}
  B=M.make {|x,y| x+y}
  a=A.new
  b=B.new
  a.eval(1) #returns 2
  b.eval(1,2) #returns 3
  </code></pre>
  
  <p>Here is the class I have thus far, which doesn't work.</p>
  
  <pre><code>class M
    def self.make &amp;blk
      Class.new do
        @@blk=blk   
        def eval *args
          @@blk.call(*args)
        end
      end
    end
  end
  </code></pre>
  
  <p>if I do the above, here is what I get.</p>
  
  <pre><code>a.eval(1) #error
  a.eval(1,2) #3
  a.eval(1,2) #3
  </code></pre>
  
  <p>So clearly it looks like this is a scope issue, but it's one that I do not know how to fix. I'd like, ideally, for each class instantiated from a class made by M to have it's own scope, and of course, to have the write eval func!</p>
  
  <p>Thanks</p>