It seems to me that in j601 j beta, sys_timer must be defined in _z_
(as opposed to the locale where wd runs). I haven't seen any
release notes on this, so I could be wrong.
But, consider what happens when I have a timer event handler
which I want to run in locale 55:
sys_timer_z_=: onTimer
This fails, because either (a) locale is not retained during
the assignment, or (b) the name is copied literally (which
has the same effect).
this=. coname''
sys_timer_z_=: onTimer__this
This fails, because the name is copied literally, and the "this"
variable is not defined in _z_
sys_timer_z_=: ''1 :('onTimer_',(>coname''),'_')
This works, but seems obscure.
(1) Perhaps name__ref should be resolved to a specific locale
at =: time?
(1a) If not, perhaps there should be some other well defined way
to get a name within a locale? (Creating a special purpose
adverb which uses a couple string concatenations works, but
does not seem to be addressing the issue at an appropriate level
of abstraction. Building a conjunction to do the composition
seems a bit better, but seems unrelated to any specific application.)
(2) Perhaps a "this" variable should be defined when creating
a new object?
Also, if the debugger is not enabled and an error occurs inside
the sys_timer function, it's difficult to retain control of the
J session. I'm not sure why this is desirable, but assuming it
is, perhaps options could be provided on what to do if an uncaught
error occurs in the timer code:
(A) the current behavior
(B) enable the debugger
(C) disable the timer
?
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm