# Code Review: Procs5

**URL:** <https://www.ruby-forum.com/t/code-review-procs5/136255>\
**Category:** IronRuby\
**Created:** [April 30, 2008, 5:16am UTC](https://www.ruby-forum.com/t/code-review-procs5/136255 "2008-04-30T05:16:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [April 30, 2008, 5:16am UTC](https://www.ruby-forum.com/t/code-review-procs5/136255/1 "2008-04-30T05:16:51Z")

</div>

tfpt review /shelveset:Procs5;REDMOND\tomat

Refactors Ruby blocks and procs:

- 

```
  The compiled block has now signature (BlockParam, self, 

```

formal-args) - self argument was added. Previously it was passed thru  
BlockParam.Proc in a very hacky way.

- 

```
  Removed hacks from dynamic actions on blocks and methods created 

```

by define\_method. Improved rules generated for these actions.

- 

```
  RubyBlockInfo no longer inherits from RubyMemberInfo. There is 

```

no reason to do so, blocks are not directly stored in method tables and  
cannot be invoked via InvokeMemberAction.

Adds YieldAction - a custom Ruby action for yielding to a block that  
allows to pass BlockParam and self.  
Implements module\_eval/class\_eval - both Proc and string versions.  
Implements eval that takes Proc as a binding.  
Adds module\_eval and proc related unit tests.

Tomas

---

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [May 1, 2008, 6:30pm UTC](https://www.ruby-forum.com/t/code-review-procs5/136255/2 "2008-05-01T18:30:30Z")

</div>

I’m assuming proc’s are 1st class things because their IDO’s which  
produce a call rule. Should the extra public properties (Id, Self,  
LocalScope, etc…) be accessible to Ruby programs? Or should they be  
internal w/ static accessors somewhere in RubyOps? Also is there a  
reason you can’t use object identity instead of ID equality - it seems  
there’ll be a 1\<-\>1 relationship here.

Otherwise looks good.

---

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [May 1, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/code-review-procs5/136255/3 "2008-05-01T19:47:21Z")

</div>

Yes, they are 1st class. Some of the properties should be accessible,  
some not. There will be more cleanup later, after all operations are  
implemented. Some fields might move among classes (RubyBlockInfo, Proc,  
BlockParam) etc. The id is now 1:1 but might not be in future - some  
blocks could be compatible if they have the same signature shape.

Tomas
