shadowed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

shadowed

Joseph Alotta
I am getting these messages on my Transcript.

What does "is shadowed" mean?

Sincerely,

Joe.





House>>report4a(sortbyrank is shadowed)
House>>report4a(sortbyrank is shadowed)
House>>report4a(sortbyrank is shadowed)
House>>report4a(sortbyrank is shadowed)
House>>report4a(sortbyrank is shadowed)
House>>report4a(sortbyrank is shadowed)
House>>loadSecurities:(array is shadowed)
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: shadowed

Tobias Pape
Hi Joe


On 02.06.2014, at 18:17, Joseph J Alotta <[hidden email]> wrote:

> I am getting these messages on my Transcript.
>
> What does "is shadowed" mean?
>

'shadowed' means that you use a temporary variable
'sortbybank' in House>>#report4a when somewhere in House or its superclasses
is there is an instance variable of the same name.
(same for array).

Best
        -Tobias

> Sincerely,
>
> Joe.
>
>
>
>
>
> House>>report4a(sortbyrank is shadowed)
> House>>report4a(sortbyrank is shadowed)
> House>>report4a(sortbyrank is shadowed)
> House>>report4a(sortbyrank is shadowed)
> House>>report4a(sortbyrank is shadowed)
> House>>report4a(sortbyrank is shadowed)
> House>>loadSecurities:(array is shadowed)
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

signature.asc (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: shadowed

Casey Ransberger-2
And to be clear, that means the temporary variable is getting used where the programmer probably thought the instance variable was being used. This is a common source of bugs, so it's usually best to avoid naming collisions between temps and ivars, and that's why the system is warning you about it.

It's a very thoughtful system:)

--Casey

> On Jun 2, 2014, at 9:35 AM, Tobias Pape <[hidden email]> wrote:
>
> Hi Joe
>
>
>> On 02.06.2014, at 18:17, Joseph J Alotta <[hidden email]> wrote:
>>
>> I am getting these messages on my Transcript.
>>
>> What does "is shadowed" mean?
>
> 'shadowed' means that you use a temporary variable
> 'sortbybank' in House>>#report4a when somewhere in House or its superclasses
> is there is an instance variable of the same name.
> (same for array).
>
> Best
>    -Tobias
>
>> Sincerely,
>>
>> Joe.
>>
>>
>>
>>
>>
>> House>>report4a(sortbyrank is shadowed)
>> House>>report4a(sortbyrank is shadowed)
>> House>>report4a(sortbyrank is shadowed)
>> House>>report4a(sortbyrank is shadowed)
>> House>>report4a(sortbyrank is shadowed)
>> House>>report4a(sortbyrank is shadowed)
>> House>>loadSecurities:(array is shadowed)
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners