[Newbies] About methods and parameters

2008-12-03 Thread Delyan Kalchev
I have several questions: 1. As I see parameter passing in Smalltalk is always call-by-reference, so within a method it is possible to do any destructive actions over the passed object. Is there a way to pass/accept a parameter as const so that it won't be changed in the method. 2. When we pass

Re: [Newbies] About methods and parameters

2008-12-03 Thread Lukas Renggli
1. As I see parameter passing in Smalltalk is always call-by-reference, so within a method it is possible to do any destructive actions over the passed object. Is there a way to pass/accept a parameter as const so that it won't be changed in the method. No, not out of the box. 2. When we

Re: [Newbies] About methods and parameters

2008-12-03 Thread Bert Freudenberg
On 03.12.2008, at 10:23, Delyan Kalchev wrote: I have several questions: Hi! Welcome to a truly object-oriented system, where you might be in for some surprises :) 1. As I see parameter passing in Smalltalk is always call-by-reference, so within a method it is possible to do any

Re: [Newbies] About methods and parameters

2008-12-03 Thread Delyan Kalchev
Hello Bert and Lukas. Thank you both for the helpful answers and thanks Bert for the warm welcome. About the first question: Actually I cannot think of a philosophical reason to limit the access to an object that the object itself permits. It seems natural with the encapsulation and now I feel