Dictionary>>at:put:

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

Dictionary>>at:put:

Tim Johnson
Hi,

I'm digging into some code I haven't touched in at least a year.  I was surprised when something which used to work no longer works.  The image has moved from a PPC Mac to a Windows PC.  It is based on 3.10.2-7179.

The error that appears to be happening is when I attempt to put something into a Dictionary at a key that doesn't exist, I'm getting an #errorKeyDoesNotExist instead of it just putting the thing into the dictionary at that (new) key.

Dictionary>>at:put: is clearly supposed to create a new key if one doesn't exist.

OK, I just did a Quit->Save and started it back up again and the problem went away.  :/

If anyone has any explanation, please share.  Otherwise since the problem is gone, you can happily ignore me :)

Thanks,
Tim

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Dictionary>>at:put:

Levente Uzonyi-2
On Fri, 11 Mar 2011, Tim Johnson wrote:

> Hi,
>
> I'm digging into some code I haven't touched in at least a year.  I was surprised when something which used to work no longer works.  The image has moved from a PPC Mac to a Windows PC.  It is based on 3.10.2-7179.
>
> The error that appears to be happening is when I attempt to put something into a Dictionary at a key that doesn't exist, I'm getting an #errorKeyDoesNotExist instead of it just putting the thing into the dictionary at that (new) key.

Is it #errorKeyNotFound?

>
> Dictionary>>at:put: is clearly supposed to create a new key if one doesn't exist.

Right. Are you sure that it's #at:put: and not #at: followed by #put:,
like here?

dictionary
  at: #foo;
  put: #bar.


Levente

>
> OK, I just did a Quit->Save and started it back up again and the problem went away.  :/
>
> If anyone has any explanation, please share.  Otherwise since the problem is gone, you can happily ignore me :)
>
> Thanks,
> Tim
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners