[#2367] Standard libraries — Dave Thomas <dave@...>

From ruby-dev summary:

60 messages 2004/02/11

[#2397] PATCH: deprecate cgi-lib, getopts, importenv, parsearg from standard library — Gavin Sinclair <gsinclair@...>

Index: cgi-lib.rb

15 messages 2004/02/12

[#2465] PATCH: OpenStruct#initialize to yield self — Gavin Sinclair <gsinclair@...>

This is a common approach I use to object initialization; I don't know

24 messages 2004/02/19

Re: Intelligent eyes needed

From: "David A. Black" <dblack@...>
Date: 2004-02-28 19:16:30 UTC
List: ruby-core #2522
Hi --

On Sun, 29 Feb 2004, Dave Thomas wrote:

> I'm in the middle of updating the Pickaxe, and I wanted to try to 
> explain better the differences between proc, Proc.new, and blocks. I 
> also wanted to explain how break, next, and return work with blocks and 
> procs.
> 
> I've come up with 
> http://www.pragmaticprogrammer.com/extracts/blocks.pdf as my first pass 
> at an explanation. If folks have time, I'd really appreciate comments, 
> both on the accuracy (Matz?) and on how clear it is. Is the explanation 
> correct? Is it as simple as possible? Have I covered all the cases?
> 
> This stuff is in the language reference section of the PickAxe, and so 
> is supposed to be a little bit terse.

(It may just be my eyes, but I think I see my last name in the first
sentence of "Return and Blocks" :-)

Possible useful tidbit: At RubyConf 2003, Matz agreed that it was a
good idea to get rid of 'proc', in favor of the exclusive use of
'lambda'.  The argument for this is that it's confusing to have "proc
{}" and "Proc.new {}" behave differently.

You've gotten around this, in a sense, with the concept of "iterator
context" and "closure context".  But I still hope "proc" goes away...
and if it's going to, that might be something you'd want to mention.

My general reaction is that what you've written is very thorough and
clear, and that it reminds me of how much I don't like the direction
Procs and blocks are going :-(  But that's for another thread.  


David

-- 
David A. Black
dblack@wobblini.net


In This Thread