[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: str1 = str2 is not a copy?!?

Gavin Kistner

11/4/2006 12:20:00 AM

From: Gregory Brown [mailto:gregory.t.brown@gmail.com]
> > array = ['you', 'loose.']
> > a, b = array
> >
> > p [a,b]
> > p array
> >
> > b = 'win!'
> > p array # Doh!!
> >
> > x = array ; x[1] = 'win!'
> > p array # array has been changed
>
> I get the point of this example, but it's worth noting that you can
> change the array via b if you just use String#replace

Wording like that promotes dangerous mental models, IMO.

*NOTHING* about the array itself changes. It still refers to exactly the
same objects as it did before. It's just that you happened to have one
of the objects that it refers to change.

Consider the example:

Person = Struct.new( :name, :age )
gavin = Person.new( 'Gavin', 33 )
lisa = Person.new( 'Lisa', 32 )

people = [ gavin, lisa ]

someone = people[ 0 ]
someone.age = 600

In the above, I am changing the 'Gavin' person to have a new age.
Because the first element in the 'people' array is that same object, you
might say that the array 'changed'. It would be better not to think of
it this way, however. The array STILL refers to Gavin and Lisa.

2 Answers

Pinballed

11/4/2010 6:25:00 PM

0

On Nov 4, 2:17 pm, Del <delmail...@gmail.com> wrote:
> On Nov 4, 1:57 pm, dirt <dirtr...@gmail.com> wrote:
>
>
>
>
>
> > On Nov 4, 1:33 pm, stangbat <stang...@gmail.com> wrote:
>
> > > I have a JP that will have the following done to it after I complete a
> > > playfield swap:
>
> > > -NOS playfield
> > > -Cliffy protectors
> > > -Several new plastics
> > > -LEDs all the way around
>
> > > I've also repaired and painted the common scratched areas inside the
> > > cabinet where the playfield can scrape when raising it.  I've cleaned
> > > and repainted the coin door, it looks really nice.  The cabinet has
> > > been touched up very nicely and looks great.  The legs have been
> > > repainted.  No problems with the translite.  DMD is good, I think
> > > there is one slightly dim vertical line.  It is 100% working.  The
> > > only thing wrong with it is the subway ramp cracked where it bolts to
> > > the VUK, so a metal bracket was made and it is attached to the VUK
> > > with it.  The repair does not effect the gameplay and it works fine.
>
> > > I didn't buy this machine to make money, so I'm not looking to recover
> > > all my costs.  But I also don't want to give it away.  I'm not in a
> > > hurry to get rid of it.  I did all this work as a project, learning
> > > experience, and to have fun.  I could remove some of the LEDs and that
> > > would make my loss on the machine less since I have over $150 in them
> > > alone.  Am I dumb for turning down $1800 cash?
>
> > I don't think you're going to ever get that price again, so if money
> > is a factor then yes your dumb. If you're happy with your workmanship
> > and want to play it and reward yourself for hardwork then your not
> > dumb at all. It just all depends on your motivations.- Hide quoted text -
>
> > - Show quoted text -
>
> I think that price is to cheap ( No you won't get it on RGP ), But E-
> Pay might treat you better, Home owners with Kids love that game & I
> got 2400.00 for mine a while back & it didn't have a new PF .
>
> Pin-Del,
> cargpb28- Hide quoted text -
>
> - Show quoted text -

I had one in super nice condition, no touch ups needed anywhere,
looked basically new and I think I sold it for $1800...maybe less but
its hard to remember now

Stan

Les Manley

11/5/2010 3:55:00 PM

0

On Nov 4, 1:17 pm, Del <delmail...@gmail.com> wrote:
> On Nov 4, 1:57 pm, dirt <dirtr...@gmail.com> wrote:
>
>
>
>
>
> > On Nov 4, 1:33 pm, stangbat <stang...@gmail.com> wrote:
>
> > > I have a JP that will have the following done to it after I complete a
> > > playfield swap:
>
> > > -NOS playfield
> > > -Cliffy protectors
> > > -Several new plastics
> > > -LEDs all the way around
>
> > > I've also repaired and painted the common scratched areas inside the
> > > cabinet where the playfield can scrape when raising it.  I've cleaned
> > > and repainted the coin door, it looks really nice.  The cabinet has
> > > been touched up very nicely and looks great.  The legs have been
> > > repainted.  No problems with the translite.  DMD is good, I think
> > > there is one slightly dim vertical line.  It is 100% working.  The
> > > only thing wrong with it is the subway ramp cracked where it bolts to
> > > the VUK, so a metal bracket was made and it is attached to the VUK
> > > with it.  The repair does not effect the gameplay and it works fine.
>
> > > I didn't buy this machine to make money, so I'm not looking to recover
> > > all my costs.  But I also don't want to give it away.  I'm not in a
> > > hurry to get rid of it.  I did all this work as a project, learning
> > > experience, and to have fun.  I could remove some of the LEDs and that
> > > would make my loss on the machine less since I have over $150 in them
> > > alone.  Am I dumb for turning down $1800 cash?
>
> > I don't think you're going to ever get that price again, so if money
> > is a factor then yes your dumb. If you're happy with your workmanship
> > and want to play it and reward yourself for hardwork then your not
> > dumb at all. It just all depends on your motivations.- Hide quoted text -
>
> > - Show quoted text -
>
> I think that price is to cheap ( No you won't get it on RGP ), But E-
> Pay might treat you better, Home owners with Kids love that game & I
> got 2400.00 for mine a while back & it didn't have a new PF .
>
> Pin-Del,
> cargpb28- Hide quoted text -
>
> - Show quoted text -

Is this $2,400 you? If so, you got the best sale price on a Jurassic
Park by far. The numbers would tell you to sell eBay and fee free
right now!

USD $1,595 Arkansas, United States 01 November, 2010
USD $1,051 California, United States 04 October, 2010 3 Bids
USD $1,500 Texas, United States 03 October, 2010 2 Bids
USD $1,595 Arkansas, United States 13 September, 2010
USD $899 Utah, United States 06 September, 2010 15 Bids
USD $1,375 Ohio, United States 30 August, 2010 9 Bids
USD $1,445 Nevada, United States 21 July, 2010 21 Bids
USD $1,650 Wisconsin, United States 03 June, 2010
USD $1,596 Pennsylvania, United States 04 May, 2010
USD $2,400 Tennessee, United States 27 April, 2010
USD $1,500 California, United States 19 March, 2010
USD $860 Georgia, United States 27 February, 2010 2 Bids
USD $1,450 California, United States 17 February, 2010
USD $1,134 Pennsylvania, United States 27 January, 2010
USD $1,525 South Carolina, United States 06 January, 2010 2 Bids
USD $1,025 Idaho, United States 15 December, 2009 19 Bids
USD $1,353 South Carolina, United States 28 November, 2009 22 Bids
USD $1,695 California, United States 25 November, 2009
USD $1,826 United States 25 November, 2009 2 Bids