[#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: PATCH: OpenStruct#initialize to yield self

From: Joel VanderWerf <vjoel@...>
Date: 2004-02-21 01:22:20 UTC
List: ruby-core #2484
Yukihiro Matsumoto wrote:
> Hi,
> 
> In message "Re: PATCH: OpenStruct#initialize to yield self"
>     on 04/02/21, Joel VanderWerf <vjoel@PATH.Berkeley.EDU> writes:
> 
> |Someone mentioned before that it lets you construct an object that can 
> |be GC-ed as soon as initialize is done. FWIW.
> 
> What is the benefit of "object that can be GC-ed as soon as initialize
> is done", which seems like useless for me?

Not much that I can see, unless all the work of the object is done in 
initialize. Even then, it only saves you from typing "obj = nil".

In This Thread