Re: length() of an atom

new topic     » goto parent     » topic index » view thread      » older message » newer message
DerekParnell said...

but now I can code ...

   --- 
   r = x[1 .. i] & q & [i+1 .. $] 
   n += length(q) 
   --- 

You should be using splice():

  r = splice( x, q, i + 1 ) 

Especially in a loop, this makes a huge difference in performance (likewise for replace(), insert() and remove()).

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu