Try evaluate "Timestamp now" and you'll see an MNU because Environment doesNotUnderstand: #keysDo:.
It's not a general problem because "Number readFrom: '1'" works as expected.
Oh, that's because I should evaluate TimeStamp, not Timestamp. So this is something triggered by an UndeclaredVariable, where the Parser's trying to correct a misspelling. The process hits Class >> #possibleVariablesFor:continuedFrom: and borks because "self environment" is insufficiently Dictionary-like.
The fix is easy enough: add #keysDo: and #associationsDo: to Environment. I'm just writing a test first demonstrating the fix before I commit anything.
frank
On Fri, Jul 27, 2012 at 5:28 AM, Frank Shearar frank.shearar@gmail.com wrote:
The fix is easy enough: add #keysDo: and #associationsDo: to Environment. I'm just writing a test first demonstrating the fix before I commit anything.
Great, thanks. I've moved your fix into the trunk so people don't stumble over the bug in the meantime.
The general strategy I'll pursue for this sort of thing is to create a new protocol for dealing with Environments, at a higher level of abstraction than the Dictionary protocol. Come to think of it, we should deprecate all the dictionary methods on Environment right off the bat. That'll provide compatibility while we complete the transition, but make it clear how Environments should be used.
Colin
On 27 July 2012 18:18, Colin Putney colin@wiresong.com wrote:
On Fri, Jul 27, 2012 at 5:28 AM, Frank Shearar frank.shearar@gmail.com wrote:
The fix is easy enough: add #keysDo: and #associationsDo: to Environment. I'm just writing a test first demonstrating the fix before I commit anything.
Great, thanks. I've moved your fix into the trunk so people don't stumble over the bug in the meantime.
The general strategy I'll pursue for this sort of thing is to create a new protocol for dealing with Environments, at a higher level of abstraction than the Dictionary protocol. Come to think of it, we should deprecate all the dictionary methods on Environment right off the bat. That'll provide compatibility while we complete the transition, but make it clear how Environments should be used.
That sounds like an excellent plan.
frank
Colin
squeak-dev@lists.squeakfoundation.org