Lorenzo Tomei wrote:

>  I'm looking for a tacit version of stringreplace verb, in 
>  order to increase performance.

Tacit isn't neccesarily faster than explicit.  

Explicit code does have the drawback that it needs to be re-interpreted before 
every application, which makes explicit verbs with
small rank slow.  But all that means is don't apply explicit verbs at small 
rank; rewrite them to apply at large rank (that's a
general rule of thumb for peformant J code, anyway).

Also, tacit code tends to be more succinct, hence amenable to introspection, 
manipulation, and optimization.  But you can still
embed the optimized tacit constructions within your explicit verbs.  Just write 
your verbs with an eye on Appendix B:
http://www.jsoftware.com/help/dictionary/special.htm  .

Other than those two points, I don't know if tacit code has any intrinsic speed 
advantage over explicit.  But I'm happy to be
corrected.

-Dan

PS:  You might also want to read  
http://www.jsoftware.com/jwiki/Essays/Non-Overlapping_Substrings  because it 
highlights a
pitfall your stringreplace might fall into (and provides methods to avoid it).

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

Reply via email to