<p dir="auto">sub2ind and ind2sub are implemented in a very slow way. Checkout my implementation and compare run time to the julia built in implementation. I observed factors of up to 50</p>
<p dir="auto">julia&gt; include("test_sub2ind.jl")<br>
Julia sub2ind 2D elapsed time: 3.071918131 seconds<br>
My sub2ind 2D    elapsed time: 0.061298908 seconds<br>
Julia ind2sub 2D elapsed time: 1.626608852 seconds<br>
My ind2sub 2D    elapsed time: 0.253709231 seconds<br>
Julia sub2ind 3D elapsed time: 4.206525844 seconds<br>
My sub2ind 3D    elapsed time: 0.080784239 seconds<br>
Julia ind2sub 3D elapsed time: 2.85505408 seconds<br>
My ind2sub 3D    elapsed time: 0.491045143 seconds</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function mysub2ind( s::Vector{Int64}, 
                    ii::Vector{Int64},jj::Vector{Int64} )
   # 2D sub2ind                 
   const nn = length(ii)

   if length(jj) != nn
      error(&quot;length(jj) != nn&quot;)
   elseif length(s) != 2
      error(&quot;length(s) != 2&quot;)
   end

   idx = Array(Int64,nn)

   const m = s[1]

   for i = 1:nn
      idx[i] = ii[i] + (jj[i]-1)*m
   end

   return idx
end  # function mysub2ind

#----------------------------------------------------

function mysub2ind( s::Vector{Int64},
                    ii::Vector{Int64},jj::Vector{Int64},kk::Vector{Int64} )
   # 3D sub2ind                 
   const nn = length(ii)

   if length(jj) != nn || length(kk) != nn
      error(&quot;length(jj) != nn&quot;)
   elseif length(s) != 3
      error(&quot;length(s) != 3&quot;)
   end

   idx = Array(Int64,nn)

   const m = s[1]
   const mn = s[1] * s[2]

   for i = 1:nn
      idx[i] = ii[i] + (jj[i]-1)*m + (kk[i]-1)*mn
   end

   return idx
end  # function mysub2ind

#-------------------------------------------------------
#-------------------------------------------------------

function myind2sub( s::Vector{Int64}, idx::Vector{Int64} )
   const nn = length(idx)

   if length(s) == 2
      ii = Array(Int64,nn)
      jj = Array(Int64,nn)

      const s1 = s[1]

      for i = 1:nn

         it = idx[i]
         ji = div(it - 1, s1) + 1
         jj[i] = ji

         ii[i] = it - (ji - 1)*s1

      end  # i

      return ii,jj

   elseif length(s) == 3

      ii = Array(Int64,nn)
      jj = Array(Int64,nn)
      kk = Array(Int64,nn)

      const s1 = s[1]
      const s12 = s[1] * s[2]

      for i = 1:nn
         idxi = idx[i]
         ki = div(idxi - 1, s12) + 1
         kk[i] = ki

         it = idxi - (ki - 1)*s12

         ji = div(it - 1, s1) + 1
         jj[i] = ji
         ii[i] = it - (ji - 1)*s1

      end  # i

      return ii,jj,kk

   else
      error(&quot;myind2sub only works for 2d or 3d arrays.&quot;)
   end

end # function myind2sub"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">mysub2ind</span>( s<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span>, 
                    ii<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span>,jj<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span> )
   <span class="pl-c"><span class="pl-c">#</span> 2D sub2ind                 </span>
   <span class="pl-k">const</span> nn <span class="pl-k">=</span> <span class="pl-c1">length</span>(ii)

   <span class="pl-k">if</span> <span class="pl-c1">length</span>(jj) <span class="pl-k">!=</span> nn
      <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>length(jj) != nn<span class="pl-pds">"</span></span>)
   <span class="pl-k">elseif</span> <span class="pl-c1">length</span>(s) <span class="pl-k">!=</span> <span class="pl-c1">2</span>
      <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>length(s) != 2<span class="pl-pds">"</span></span>)
   <span class="pl-k">end</span>

   idx <span class="pl-k">=</span> <span class="pl-c1">Array</span>(Int64,nn)

   <span class="pl-k">const</span> m <span class="pl-k">=</span> s[<span class="pl-c1">1</span>]

   <span class="pl-k">for</span> i <span class="pl-k">=</span> <span class="pl-c1">1</span><span class="pl-k">:</span>nn
      idx[i] <span class="pl-k">=</span> ii[i] <span class="pl-k">+</span> (jj[i]<span class="pl-k">-</span><span class="pl-c1">1</span>)<span class="pl-k">*</span>m
   <span class="pl-k">end</span>

   <span class="pl-k">return</span> idx
<span class="pl-k">end</span>  <span class="pl-c"><span class="pl-c">#</span> function mysub2ind</span>

<span class="pl-c"><span class="pl-c">#</span>----------------------------------------------------</span>

<span class="pl-k">function</span> <span class="pl-en">mysub2ind</span>( s<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span>,
                    ii<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span>,jj<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span>,kk<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span> )
   <span class="pl-c"><span class="pl-c">#</span> 3D sub2ind                 </span>
   <span class="pl-k">const</span> nn <span class="pl-k">=</span> <span class="pl-c1">length</span>(ii)

   <span class="pl-k">if</span> <span class="pl-c1">length</span>(jj) <span class="pl-k">!=</span> nn <span class="pl-k">||</span> <span class="pl-c1">length</span>(kk) <span class="pl-k">!=</span> nn
      <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>length(jj) != nn<span class="pl-pds">"</span></span>)
   <span class="pl-k">elseif</span> <span class="pl-c1">length</span>(s) <span class="pl-k">!=</span> <span class="pl-c1">3</span>
      <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>length(s) != 3<span class="pl-pds">"</span></span>)
   <span class="pl-k">end</span>

   idx <span class="pl-k">=</span> <span class="pl-c1">Array</span>(Int64,nn)

   <span class="pl-k">const</span> m <span class="pl-k">=</span> s[<span class="pl-c1">1</span>]
   <span class="pl-k">const</span> mn <span class="pl-k">=</span> s[<span class="pl-c1">1</span>] <span class="pl-k">*</span> s[<span class="pl-c1">2</span>]

   <span class="pl-k">for</span> i <span class="pl-k">=</span> <span class="pl-c1">1</span><span class="pl-k">:</span>nn
      idx[i] <span class="pl-k">=</span> ii[i] <span class="pl-k">+</span> (jj[i]<span class="pl-k">-</span><span class="pl-c1">1</span>)<span class="pl-k">*</span>m <span class="pl-k">+</span> (kk[i]<span class="pl-k">-</span><span class="pl-c1">1</span>)<span class="pl-k">*</span>mn
   <span class="pl-k">end</span>

   <span class="pl-k">return</span> idx
<span class="pl-k">end</span>  <span class="pl-c"><span class="pl-c">#</span> function mysub2ind</span>

<span class="pl-c"><span class="pl-c">#</span>-------------------------------------------------------</span>
<span class="pl-c"><span class="pl-c">#</span>-------------------------------------------------------</span>

<span class="pl-k">function</span> <span class="pl-en">myind2sub</span>( s<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span>, idx<span class="pl-k">::</span><span class="pl-c1">Vector{Int64}</span> )
   <span class="pl-k">const</span> nn <span class="pl-k">=</span> <span class="pl-c1">length</span>(idx)

   <span class="pl-k">if</span> <span class="pl-c1">length</span>(s) <span class="pl-k">==</span> <span class="pl-c1">2</span>
      ii <span class="pl-k">=</span> <span class="pl-c1">Array</span>(Int64,nn)
      jj <span class="pl-k">=</span> <span class="pl-c1">Array</span>(Int64,nn)

      <span class="pl-k">const</span> s1 <span class="pl-k">=</span> s[<span class="pl-c1">1</span>]

      <span class="pl-k">for</span> i <span class="pl-k">=</span> <span class="pl-c1">1</span><span class="pl-k">:</span>nn

         it <span class="pl-k">=</span> idx[i]
         ji <span class="pl-k">=</span> <span class="pl-c1">div</span>(it <span class="pl-k">-</span> <span class="pl-c1">1</span>, s1) <span class="pl-k">+</span> <span class="pl-c1">1</span>
         jj[i] <span class="pl-k">=</span> ji

         ii[i] <span class="pl-k">=</span> it <span class="pl-k">-</span> (ji <span class="pl-k">-</span> <span class="pl-c1">1</span>)<span class="pl-k">*</span>s1

      <span class="pl-k">end</span>  <span class="pl-c"><span class="pl-c">#</span> i</span>

      <span class="pl-k">return</span> ii,jj

   <span class="pl-k">elseif</span> <span class="pl-c1">length</span>(s) <span class="pl-k">==</span> <span class="pl-c1">3</span>

      ii <span class="pl-k">=</span> <span class="pl-c1">Array</span>(Int64,nn)
      jj <span class="pl-k">=</span> <span class="pl-c1">Array</span>(Int64,nn)
      kk <span class="pl-k">=</span> <span class="pl-c1">Array</span>(Int64,nn)

      <span class="pl-k">const</span> s1 <span class="pl-k">=</span> s[<span class="pl-c1">1</span>]
      <span class="pl-k">const</span> s12 <span class="pl-k">=</span> s[<span class="pl-c1">1</span>] <span class="pl-k">*</span> s[<span class="pl-c1">2</span>]

      <span class="pl-k">for</span> i <span class="pl-k">=</span> <span class="pl-c1">1</span><span class="pl-k">:</span>nn
         idxi <span class="pl-k">=</span> idx[i]
         ki <span class="pl-k">=</span> <span class="pl-c1">div</span>(idxi <span class="pl-k">-</span> <span class="pl-c1">1</span>, s12) <span class="pl-k">+</span> <span class="pl-c1">1</span>
         kk[i] <span class="pl-k">=</span> ki

         it <span class="pl-k">=</span> idxi <span class="pl-k">-</span> (ki <span class="pl-k">-</span> <span class="pl-c1">1</span>)<span class="pl-k">*</span>s12

         ji <span class="pl-k">=</span> <span class="pl-c1">div</span>(it <span class="pl-k">-</span> <span class="pl-c1">1</span>, s1) <span class="pl-k">+</span> <span class="pl-c1">1</span>
         jj[i] <span class="pl-k">=</span> ji
         ii[i] <span class="pl-k">=</span> it <span class="pl-k">-</span> (ji <span class="pl-k">-</span> <span class="pl-c1">1</span>)<span class="pl-k">*</span>s1

      <span class="pl-k">end</span>  <span class="pl-c"><span class="pl-c">#</span> i</span>

      <span class="pl-k">return</span> ii,jj,kk

   <span class="pl-k">else</span>
      <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>myind2sub only works for 2d or 3d arrays.<span class="pl-pds">"</span></span>)
   <span class="pl-k">end</span>

<span class="pl-k">end</span> <span class="pl-c"><span class="pl-c">#</span> function myind2sub</span></pre></div>
<p dir="auto">Now the test</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
include(&quot;mysub2ind.jl&quot;)

# 2D test
mrow = 10000
ncol = 20000

pfil = 0.1
nz = trunc(Int64, mrow*ncol*pfil)  # # of non-zeros

ii = rand(1:mrow, nz)
jj = rand(1:ncol, nz)


print(&quot;Julia sub2ind 2D &quot;)
tic()
idx = sub2ind( (mrow,ncol), ii,jj );
toc()

print(&quot;My sub2ind 2D    &quot;)
tic()
idx2 = mysub2ind( [mrow,ncol], ii,jj );
toc()


er = norm(idx - idx2)
if er != 0
   error(&quot;mysub2ind error&quot;)
end

print(&quot;Julia ind2sub 2D &quot;)

tic()
ii2,jj2 = ind2sub((mrow,ncol), idx)
toc()
er = norm(ii2 - ii) + norm(jj2 - jj)
if er != 0
   error(&quot;ind2sub error&quot;)
end

print(&quot;My ind2sub 2D    &quot;)

tic()
ii3,jj3 = myind2sub([mrow,ncol], idx2)
toc()

er = norm(ii3 - ii) + norm(jj3 - jj)
if er != 0
   error(&quot;myind2sub error&quot;)
end

#------------------------------------------------

# 3D test

m1 = 1024
m2 = 2048
m3 = 512

pfil = 0.02
nz = trunc(Int64, m1*m2*m3*pfil)  # # of non-zeros

ii = rand(1:m1, nz)
jj = rand(1:m2, nz)
kk = rand(1:m3, nz)

print(&quot;Julia sub2ind 3D &quot;)

tic()
idx = sub2ind( (m1,m2,m3), ii,jj,kk );
toc()

print(&quot;My sub2ind 3D    &quot;)

tic()
idx2 = mysub2ind( [m1,m2,m3], ii,jj,kk );
toc()

er = norm(idx - idx2)
if er != 0
   error(&quot;mysub2ind error&quot;)
end

print(&quot;Julia ind2sub 3D &quot;)

tic()
ii2,jj2,kk2 = ind2sub((m1,m2,m3), idx)
toc()
er = norm(ii2 - ii) + norm(jj2 - jj) + norm(kk2 - kk)
if er != 0
   error(&quot;ind2sub error&quot;)
end

print(&quot;My ind2sub 3D    &quot;)

tic()
ii3,jj3,kk3 = myind2sub([m1,m2,m3], idx2)
toc()

er = norm(ii3 - ii) + norm(jj3 - jj) + norm(kk3 - kk)
if er != 0
   error(&quot;myind2sub error&quot;)
end
"><pre class="notranslate"><span class="pl-c1">include</span>(<span class="pl-s"><span class="pl-pds">"</span>mysub2ind.jl<span class="pl-pds">"</span></span>)

<span class="pl-c"><span class="pl-c">#</span> 2D test</span>
mrow <span class="pl-k">=</span> <span class="pl-c1">10000</span>
ncol <span class="pl-k">=</span> <span class="pl-c1">20000</span>

pfil <span class="pl-k">=</span> <span class="pl-c1">0.1</span>
nz <span class="pl-k">=</span> <span class="pl-c1">trunc</span>(Int64, mrow<span class="pl-k">*</span>ncol<span class="pl-k">*</span>pfil)  <span class="pl-c"><span class="pl-c">#</span> # of non-zeros</span>

ii <span class="pl-k">=</span> <span class="pl-c1">rand</span>(<span class="pl-c1">1</span><span class="pl-k">:</span>mrow, nz)
jj <span class="pl-k">=</span> <span class="pl-c1">rand</span>(<span class="pl-c1">1</span><span class="pl-k">:</span>ncol, nz)


<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>Julia sub2ind 2D <span class="pl-pds">"</span></span>)
<span class="pl-c1">tic</span>()
idx <span class="pl-k">=</span> <span class="pl-c1">sub2ind</span>( (mrow,ncol), ii,jj );
<span class="pl-c1">toc</span>()

<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>My sub2ind 2D    <span class="pl-pds">"</span></span>)
<span class="pl-c1">tic</span>()
idx2 <span class="pl-k">=</span> <span class="pl-c1">mysub2ind</span>( [mrow,ncol], ii,jj );
<span class="pl-c1">toc</span>()


er <span class="pl-k">=</span> <span class="pl-c1">norm</span>(idx <span class="pl-k">-</span> idx2)
<span class="pl-k">if</span> er <span class="pl-k">!=</span> <span class="pl-c1">0</span>
   <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>mysub2ind error<span class="pl-pds">"</span></span>)
<span class="pl-k">end</span>

<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>Julia ind2sub 2D <span class="pl-pds">"</span></span>)

<span class="pl-c1">tic</span>()
ii2,jj2 <span class="pl-k">=</span> <span class="pl-c1">ind2sub</span>((mrow,ncol), idx)
<span class="pl-c1">toc</span>()
er <span class="pl-k">=</span> <span class="pl-c1">norm</span>(ii2 <span class="pl-k">-</span> ii) <span class="pl-k">+</span> <span class="pl-c1">norm</span>(jj2 <span class="pl-k">-</span> jj)
<span class="pl-k">if</span> er <span class="pl-k">!=</span> <span class="pl-c1">0</span>
   <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>ind2sub error<span class="pl-pds">"</span></span>)
<span class="pl-k">end</span>

<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>My ind2sub 2D    <span class="pl-pds">"</span></span>)

<span class="pl-c1">tic</span>()
ii3,jj3 <span class="pl-k">=</span> <span class="pl-c1">myind2sub</span>([mrow,ncol], idx2)
<span class="pl-c1">toc</span>()

er <span class="pl-k">=</span> <span class="pl-c1">norm</span>(ii3 <span class="pl-k">-</span> ii) <span class="pl-k">+</span> <span class="pl-c1">norm</span>(jj3 <span class="pl-k">-</span> jj)
<span class="pl-k">if</span> er <span class="pl-k">!=</span> <span class="pl-c1">0</span>
   <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>myind2sub error<span class="pl-pds">"</span></span>)
<span class="pl-k">end</span>

<span class="pl-c"><span class="pl-c">#</span>------------------------------------------------</span>

<span class="pl-c"><span class="pl-c">#</span> 3D test</span>

m1 <span class="pl-k">=</span> <span class="pl-c1">1024</span>
m2 <span class="pl-k">=</span> <span class="pl-c1">2048</span>
m3 <span class="pl-k">=</span> <span class="pl-c1">512</span>

pfil <span class="pl-k">=</span> <span class="pl-c1">0.02</span>
nz <span class="pl-k">=</span> <span class="pl-c1">trunc</span>(Int64, m1<span class="pl-k">*</span>m2<span class="pl-k">*</span>m3<span class="pl-k">*</span>pfil)  <span class="pl-c"><span class="pl-c">#</span> # of non-zeros</span>

ii <span class="pl-k">=</span> <span class="pl-c1">rand</span>(<span class="pl-c1">1</span><span class="pl-k">:</span>m1, nz)
jj <span class="pl-k">=</span> <span class="pl-c1">rand</span>(<span class="pl-c1">1</span><span class="pl-k">:</span>m2, nz)
kk <span class="pl-k">=</span> <span class="pl-c1">rand</span>(<span class="pl-c1">1</span><span class="pl-k">:</span>m3, nz)

<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>Julia sub2ind 3D <span class="pl-pds">"</span></span>)

<span class="pl-c1">tic</span>()
idx <span class="pl-k">=</span> <span class="pl-c1">sub2ind</span>( (m1,m2,m3), ii,jj,kk );
<span class="pl-c1">toc</span>()

<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>My sub2ind 3D    <span class="pl-pds">"</span></span>)

<span class="pl-c1">tic</span>()
idx2 <span class="pl-k">=</span> <span class="pl-c1">mysub2ind</span>( [m1,m2,m3], ii,jj,kk );
<span class="pl-c1">toc</span>()

er <span class="pl-k">=</span> <span class="pl-c1">norm</span>(idx <span class="pl-k">-</span> idx2)
<span class="pl-k">if</span> er <span class="pl-k">!=</span> <span class="pl-c1">0</span>
   <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>mysub2ind error<span class="pl-pds">"</span></span>)
<span class="pl-k">end</span>

<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>Julia ind2sub 3D <span class="pl-pds">"</span></span>)

<span class="pl-c1">tic</span>()
ii2,jj2,kk2 <span class="pl-k">=</span> <span class="pl-c1">ind2sub</span>((m1,m2,m3), idx)
<span class="pl-c1">toc</span>()
er <span class="pl-k">=</span> <span class="pl-c1">norm</span>(ii2 <span class="pl-k">-</span> ii) <span class="pl-k">+</span> <span class="pl-c1">norm</span>(jj2 <span class="pl-k">-</span> jj) <span class="pl-k">+</span> <span class="pl-c1">norm</span>(kk2 <span class="pl-k">-</span> kk)
<span class="pl-k">if</span> er <span class="pl-k">!=</span> <span class="pl-c1">0</span>
   <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>ind2sub error<span class="pl-pds">"</span></span>)
<span class="pl-k">end</span>

<span class="pl-c1">print</span>(<span class="pl-s"><span class="pl-pds">"</span>My ind2sub 3D    <span class="pl-pds">"</span></span>)

<span class="pl-c1">tic</span>()
ii3,jj3,kk3 <span class="pl-k">=</span> <span class="pl-c1">myind2sub</span>([m1,m2,m3], idx2)
<span class="pl-c1">toc</span>()

er <span class="pl-k">=</span> <span class="pl-c1">norm</span>(ii3 <span class="pl-k">-</span> ii) <span class="pl-k">+</span> <span class="pl-c1">norm</span>(jj3 <span class="pl-k">-</span> jj) <span class="pl-k">+</span> <span class="pl-c1">norm</span>(kk3 <span class="pl-k">-</span> kk)
<span class="pl-k">if</span> er <span class="pl-k">!=</span> <span class="pl-c1">0</span>
   <span class="pl-c1">error</span>(<span class="pl-s"><span class="pl-pds">"</span>myind2sub error<span class="pl-pds">"</span></span>)
<span class="pl-k">end</span>
</pre></div>
<p dir="auto">I'm updating ApproxFun and this caught me by surprise:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="abstract Foo
julia&gt; (f::Foo)(x)=x
ERROR: cannot add methods to an abstract type
 in eval(::Module, ::Any) at ./boot.jl:267"><pre class="notranslate">abstract Foo
julia<span class="pl-k">&gt;</span> (f<span class="pl-k">::</span><span class="pl-c1">Foo</span>)(x)<span class="pl-k">=</span>x
ERROR<span class="pl-k">:</span> cannot add methods to an <span class="pl-k">abstract type</span>
 <span class="pl-k">in</span> <span class="pl-c1">eval</span>(<span class="pl-k">::</span><span class="pl-c1">Module</span>, <span class="pl-k">::</span><span class="pl-c1">Any</span>) at <span class="pl-k">./</span>boot<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">267</span></pre></div>
<p dir="auto">Is this intentional?  Is there a way to get around this other than define for each subtype:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; immutable CFoo &lt;: Foo end
julia&gt; (f::CFoo)(x)=x"><pre class="notranslate">julia<span class="pl-k">&gt;</span> immutable CFoo <span class="pl-k">&lt;:</span> <span class="pl-c1">Foo</span> <span class="pl-k">end</span>
julia<span class="pl-k">&gt;</span> (f<span class="pl-k">::</span><span class="pl-c1">CFoo</span>)(x)<span class="pl-k">=</span>x</pre></div>