package com.xruby.runtime.builtin;

import com.xruby.runtime.lang.*;
import com.xruby.runtime.value.*;

class Proc_call extends RubyMethod {
	public Proc_call() {
		super(0);
	}

	protected RubyValue run(RubyValue receiver, RubyArray args, RubyBlock block) {
		RubyBlock b = ((RubyProc)receiver).getValue();
		return b.invoke(receiver, args);
	}
}

public class ProcClassBuilder {
	
	public static void initialize() {
		RubyClass c = RubyRuntime.ProcClass;
		c.defineMethod("call", new Proc_call());
	}
}
@@ -358,16 +358,233 @@
 %7D%0D%0A%7D%0D%0A%0D%0A
+class Proc_alloc extends RubyMethod %7B%0D%0A%09public Proc_alloc() %7B%0D%0A%09%09super(-1);%0D%0A%09%7D%0D%0A%09%0D%0A%09protected RubyValue run(RubyValue receiver, RubyArray args, RubyBlock block) %7B%0D%0A%09%09return ObjectFactory.createProc(block);%0D%0A%09%7D%0D%0A%7D%0D%0A%0D%0A
 public c
@@ -727,17 +727,59 @@
 c_call());%0D%0A
+%09%09c.defineAllocMethod(new Proc_alloc());%0D%0A
 %09%7D%0D%0A%7D

add Proc#new