[#927] UnboundMethod#to_proc — Dave Thomas <dave@...>
I'm wondering what I can do with a Proc generated by
17 messages
2003/04/06
[#929] Re: UnboundMethod#to_proc
— "Chris Pine" <nemo@...>
2003/04/06
----- Original Message -----
[#934] Re: UnboundMethod#to_proc
— Mathieu Bouchard <matju@...>
2003/04/06
[#940] Re: UnboundMethod#to_proc
— chr_news@...
2003/04/07
>
[#941] Re: UnboundMethod#to_proc
— Dave Thomas <dave@...>
2003/04/07
>> If they have diverging interfaces such that the contracts conflict
[#936] docs on implementation of ruby and/or ruby-gc ? — Ruben Vandeginste <Ruben.Vandeginste@...>
4 messages
2003/04/07
[#964] Range in logical context — Dave Thomas <dave@...>
If I run
7 messages
2003/04/16
[#965] Re: Range in logical context
— Mauricio Fern疣dez <batsman.geo@...>
2003/04/16
On Thu, Apr 17, 2003 at 06:10:40AM +0900, Dave Thomas wrote:
[#973] problem with rb_rescue2() ? — Mathieu Bouchard <matju@...>
5 messages
2003/04/19
Re: String.allocate etc...
From:
Ryan Pavlik <rpav@...>
Date:
2003-04-11 18:16:10 UTC
List:
ruby-core #957
On Fri, 11 Apr 2003 22:56:53 +0900 Dave Thomas <dave@thomases.com> wrote: > > Just wondering... why are the .allocate methods public? Using them, I > can bypass the initialization that the class designer intended for > objects, and so break class invariants. > THIS IS GOOD. (Actually.) ;-) It allows one to allocate an object, do things to it, then call initialize manually. This is _extremely_ useful. For instance, in Mephle, I use this to initialize instance variables @_oid, @_volume, @_owner, and (optionally) @_server. Without these, when initialize is called, there is no way to allocate other persistant objects, since the object itself doesn't know where it exists! (Passing these as parameters is unacceptable. Not only is it extra overhead for the coder, it prevents preexisting classes from fitting into the scheme. Currently I have @_oid et al. added to Object, along with the proper Object#new_on(connection, volume, ...) for allocation. It works _very_ well.) I had to move to ruby 1.8 because #allocate was necessary for this system. There really is no other good way. -- Ryan Pavlik <rpav@users.sf.net> "That's the first pratical line of thinking to come out of your word hole since we first met." - 8BT