Login  Register

Re: I need some explaination about arguements assignment

Posted by S Krish on Aug 07, 2014; 6:31am
URL: https://forum.world.st/I-need-some-explaination-about-arguements-assignment-tp4772102p4772113.html


See enclosed screen shot..


On Thu, Aug 7, 2014 at 11:59 AM, S Krish <[hidden email]> wrote:

ok something your post does bring up intrinsically not ok with Pharo, but not threatening a bug, as in normal code practice:

                   a) We should never assign values into the arguments..

On compiling ..

As I see it, the Pharo compiler makes "aText" now a temp variable of the block ( actually the while loop is not relevant .. )
The argument "aNumb" actually takes on the value of the first argument viz: of the passed aText..

It would be nicer if the compiler refuses to accept assignment to an argument of the method..

As for suggestion that you liked, I would suggest simply run through Pharo By Example first thoroughly... and then take up as much of test runs through existing applications to understand some of the concepts of how to code..
 



assign_to_arg.png (108K) Download Attachment