From: "Mauricio Fernández" Date: 2002-10-25T00:20:45+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (10/16/02) On Thu, Oct 24, 2002 at 11:23:05PM +0900, William Djaja Tjokroaminata wrote: > Mauricio Fern?ndez wrote: > > How many do need several references to the same string from the C side? > > > If the number is high enough (ie, > a couple of them) doing this would > > be pointless :-( > > > Bah, just have to find another thing to work on :) > > Hi batsman, > > I think the point is not *how many* but just if *there exists* some C code > that may have more than one references to a Ruby object. I was thinking 'how many' because I could always "fix" them if it's only a couple. > Also, are you trying to do this only for the String objects? (i.e., "aStr > +=" means "aStr <<" if there is only one reference count to the > object referred to by aStr.) > Two things here: * I was considering this a "one-time hack" only for String objects, as a simple exercise to get to know Ruby's AST interpretation * it would only work for String, as it is a class we understand fairly well, and I cannot think of any circumstances (in Ruby code, of course) that require "+=" to create a new object but those I cited previously. Better forget about it; I might do it on my own but it seems it has little --- if any --- value but the educational one :-) killall -9 this-thread -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com No, that's wrong too. Now there's a race condition between the rm and the mv. Hmm, I need more coffee. -- Guy Maor on Debian Bug#25228