Help / Release / J 7.01 / #\ and #\. Improved

From J Wiki
Jump to navigation Jump to search


>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release



#\ and #\. Improved

initial writing: 2010-08-05
last updated: 2010-08-05


The monads #\ and #\. are now implemented by special code and are faster and leaner (linear instead of quadratic).

   #\ 7$'a'
1 2 3 4 5 6 7
   #\. 7$'a'
7 6 5 4 3 2 1

   x=: 1e6 $ 'palindromic'
   ts=: 6!:2 , 7!:2@]  NB. time and space

   ts '#\x'
0.00905422 4.19501e6
   ts '#\.x'
0.00906344 4.19501e6

   NB. in contrast
   ts '1+i.#x'
0.0194871 8.38931e6
   ts '1+i.-#x'
0.0212759 8.38944e6




>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release