Thanks for the elegant and faster solution.
Non-numeric x and y can be handled by
t{~&> rpl12&.>/ (t=.x<@,&,y) i.&.>x;y
R.E. Boss
> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] [mailto:programming-
> [EMAIL PROTECTED] Namens Raul Miller
> Verzonden: dinsdag 3 juli 2007 17:27
> Aan: Programming forum
> Onderwerp: Re: [Jprogramming] Replacement
>
> On 7/3/07, R.E. Boss <[EMAIL PROTECTED]> wrote:
> > What is the fastest way to replace the atoms in y which occur in {.x by
> the
> > corresponding values in {:x, where 2={.$x and 2=#$x?
>
> For numeric y, this seems faster:
> rpl2=: ] - (0 ,~ -/)@[ {~ ] i.~ [EMAIL PROTECTED]
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm