[Pharo-project] MethodContext #tempScopedNames vs #tempAt
Hi While trying to debug the debugger in Seaside (hi Mike) I stumbled on something funny. Seaside the following code to work: Semaphore forMutualExclusion critical: [ | sender | sender := thisContext sender. sender tempAt: sender tempScopedNames size ] But it doesn't, you get a SubscriptOutOfBounds. #tempScopedNames answers #('mutuallyExcludedBlock' 'blockValue' 'caught'). The method arguments (mutuallyExcludedBlock) can be found in self tempAt: 1 the temps can be found in self tempAt: 2 Which means that sender tempNamed: 'blockValue' will answer #(nil true) instead of the real value (nil). This is very confusing. This is with the latest Pharo 1.3 and Cog .r2489 Cheers Philippe
Hi Phillipe, On Mon, Sep 12, 2011 at 11:06 AM, Philippe Marschall <kustos@gmx.net> wrote:
Hi
While trying to debug the debugger in Seaside (hi Mike) I stumbled on something funny. Seaside the following code to work:
Semaphore forMutualExclusion critical: [ | sender | sender := thisContext sender. sender tempAt: sender tempScopedNames size ]
This just won't work with the Closure compiler. This approach only worked with old blue-book blocks Squeak. Instead you need to look at DebuggerMethodMap, tempNamesForContext:, namedTempAt: et al.
But it doesn't, you get a SubscriptOutOfBounds. #tempScopedNames answers #('mutuallyExcludedBlock' 'blockValue' 'caught'). The method arguments (mutuallyExcludedBlock) can be found in self tempAt: 1 the temps can be found in self tempAt: 2
Which means that sender tempNamed: 'blockValue' will answer #(nil true) instead of the real value (nil). This is very confusing.
This is with the latest Pharo 1.3 and Cog .r2489
Cheers Philippe
-- best, Eliot
On 12.09.2011 23:11, Eliot Miranda wrote:
Hi Phillipe,
On Mon, Sep 12, 2011 at 11:06 AM, Philippe Marschall <kustos@gmx.net <mailto:kustos@gmx.net>> wrote:
Hi
While trying to debug the debugger in Seaside (hi Mike) I stumbled on something funny. Seaside the following code to work:
Semaphore forMutualExclusion critical: [ | sender | sender := thisContext sender. sender tempAt: sender tempScopedNames size ]
This just won't work with the Closure compiler. This approach only worked with old blue-book blocks Squeak. Instead you need to look at DebuggerMethodMap, tempNamesForContext:, namedTempAt: et al.
Ok, I tried implementing it in terms of #tempNamesForContext: (through #tempNames) and #namedTempAt: this works sometimes and in other times I get 'Instances of UndefinedObject are not indexable'. See the attached unit test. Cheers Philippe
On 13.09.2011 18:54, Philippe Marschall wrote:
On 12.09.2011 23:11, Eliot Miranda wrote:
Hi Phillipe,
On Mon, Sep 12, 2011 at 11:06 AM, Philippe Marschall <kustos@gmx.net <mailto:kustos@gmx.net>> wrote:
Hi
While trying to debug the debugger in Seaside (hi Mike) I stumbled on something funny. Seaside the following code to work:
Semaphore forMutualExclusion critical: [ | sender | sender := thisContext sender. sender tempAt: sender tempScopedNames size ]
This just won't work with the Closure compiler. This approach only worked with old blue-book blocks Squeak. Instead you need to look at DebuggerMethodMap, tempNamesForContext:, namedTempAt: et al.
Ok, I tried implementing it in terms of #tempNamesForContext: (through #tempNames) and #namedTempAt: this works sometimes and in other times I get 'Instances of UndefinedObject are not indexable'. See the attached unit test.
I just checked and this was working in 1.2. Cheers Philippe
participants (2)
-
Eliot Miranda -
Philippe Marschall