|
Object copyFrom: [was: Object clone]: msg#00066lang.smalltalk.squeak.beginners
Hi Jakub, on Tue, 15 Jan 2008 18:29:53 +0100, you wrote: yeah a, b instance of same class and i want copy all instance variables If you mean to have class Person and (aPerson := Person new), (bPerson := Person new) and later you want that aPerson has exactly the same instance variables as bPerson, then you might want aPerson copyFrom: bPerson This is not often used (it's rather at the system level), because most Smalltalk developers set instance variables by mutators, like aPerson name: bPerson name. aPerson address: bPerson address. ... See also the comment in #copyFrom: on the instance side of Object. Enjoy Smalltalk :) /Klaus but if i change a i dont
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Object clone, Randal L. Schwartz |
|---|---|
| Next by Date: | squeak twexter?, duke crawford |
| Previous by Thread: | Re: Object clone, Xinyu Liu |
| Next by Thread: | squeak twexter?, duke crawford |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |