From: matz@... (Yukihiro Matsumoto) Date: 2001-05-25T14:09:30+09:00 Subject: [ruby-talk:15697] Re: Q: Function modification/Procedures Hi, In message "[ruby-talk:15689] Re: Q: Function modification/Procedures" on 01/05/25, Daishi Harada writes: |I have another related question. To make a parametrized function |creator, I first tried something like: | |class Adder < Proc | def initialize(n) | @n = n | end | def call(x) | x+@n | end |end | |This broke since Proc expects a block on initialization, so you can't |just do: | |add2 = Adder.new(2) Hmm, why did you inherit from Proc? Your Adder has nothing related to Proc, doesn't it? matz.