On 7/12/06, R&S HUI <[EMAIL PROTECTED]> wrote:
The prospects for more efficient computation improves if you say
 name=: x u@:{`[`]} name      NB. (0)
 name=: x u`[`]} name         NB. (1)
instead of
 name=: x reverse amend name  NB. (2)
 name=: x |.@:{ amend name    NB. (3)
It is easier and more productive for the prospective special code to
handle (0) and (1) than (2) or (3).

i do gather that special code does not like "cover functions". But
currently the flexibility/generality offered by the namings does not
seem to make a significant difference:

  ii=:(1 2; 2 0)
  xx=:i. 999 999
  10 Ts 'ii reverse`[`]} xx'
0.0163818 4.1968e6
  10 Ts 'ii ([:|.{)`[`]} xx'
0.0192198 4.19686e6
  10 Ts 'ii reverse amend xx'
0.0194623 4.19674e6
  10 Ts 'ii swapG xx'
0.0159129 4.19578e6

i had been hoping there might be a more efficient way of doing what i
was doing...

Is there some prospect for special coding for this more generic swap
functionality? i would certainly forgo the perspicuity and generality
if there were such a prospect - though i dislike such hard coding
which is hard to maintain and read. It is a significant time sink in
my app.

~greg
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to