I don't think I got my point across.

All my socket code, as it happens, runs in the locale 'asyncsocket'. 
(But that isn't really important).

When a socket event occurs, the sentence

    socket_handler''

is executed.  That lets you know to look and see what the socket 
activity was.

The problem is that that sentence is executed in the locale associated 
with the keyboard at the time the socket event arrives.  Normally that 
would be 'base'.

But, say you're debugging your system and you decide you want to look at 
or execute stuff in locale xyz.  You type, at the keyboard in 
immediate-entry mode,

   cocurrent 'xyz'

and you get ready to debug, but before you can do much, you get

| value error: socket_handler

because the aforementioned sentence is now executed in locale xyz.

You can arrange to make socket_handler defined no matter where you are 
(by putting it into _z_), or Eric could call socket_handler_base_ 
explicitly.

Henry Rich



Raul Miller wrote:
> On Fri, Jul 31, 2009 at 1:07 PM, Henry Rich<[email protected]> wrote:
>> I can paper over this by defining socket_handler_z_, but I suggest that
>> for Eric to make the call to socket_handler_base_ would be a better
>> solution.
> 
> I think this would be a bad change.
> 
> The current approach lets you define an object which encapsulates
> socket activity.
> 
> Your suggestion would prevent this kind of encapsulation.
> 
> The workaround for your situation would seem to be to arrange so
> that your code which starts some socket activity always does so
> in the appropriate class.  This might be as simple as arranging for
> a well defined entry point to your socket initialization code.
> 
> But maybe I am mistaken?
> 
> Thanks,
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to