"Devon McCormick" <[EMAIL PROTECTED]> writes:
> NB. where we extend standard replace function:
> multiReplace=: 4 : 0
> NB.* multiReplace: multiple replacement, sequentially, using pairs in x.
> NB. to alter y..
> parms=. x. NB. Reshape vector arg to 2-col mat.
> if. 1=#shp=. $parms do. parms=. (0 2+0.5 0*2$shp)$parms end.
> template=. y.
> while. 0<#parms do.
> template=. (0{parms) replace template
> parms=. }.parms
> end.
> template
> NB.EG ('s';'is';'this';'glorp') multiReplace 'ths s a tst'
> )
Devon,
Pardon my blind spot, but where is the "standard replace function"? I
can't find it. I can find rplc, but that didn't work (neither did
x. and y., but I changed those, too).
Thanks,
Bill
--
Bill Harris http://facilitatedsystems.com/weblog/
Facilitated Systems Everett, WA 98208 USA
http://facilitatedsystems.com/ phone: +1 425 337-5541
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm