<p dir="auto">The line <code class="notranslate">reslist[ resindex -1 ]</code> gives the following error (because of the <code class="notranslate">-1</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: MethodError: `typed_hcat` has no method matching typed_hcat(::Array{MIToS.PDB.PDBResidue,1}, ::Int64, ::Int64)
Closest candidates are:
  typed_hcat(::Type{T}, ::Number...)
  typed_hcat(::Type{T}, ::Any...)"><pre class="notranslate"><code class="notranslate">ERROR: MethodError: `typed_hcat` has no method matching typed_hcat(::Array{MIToS.PDB.PDBResidue,1}, ::Int64, ::Int64)
Closest candidates are:
  typed_hcat(::Type{T}, ::Number...)
  typed_hcat(::Type{T}, ::Any...)
</code></pre></div>
<p dir="auto">This gives the following error:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; A = zeros(5)
       for i in 1:3
            A[2*i -1] = 10
       end
ERROR: syntax: invalid spacing in left side of indexed assignment
 in eval at ./boot.jl:267"><pre class="notranslate">julia<span class="pl-k">&gt;</span> A <span class="pl-k">=</span> <span class="pl-c1">zeros</span>(<span class="pl-c1">5</span>)
       <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">3</span>
            A[<span class="pl-c1">2</span><span class="pl-k">*</span>i <span class="pl-k">-</span><span class="pl-c1">1</span>] <span class="pl-k">=</span> <span class="pl-c1">10</span>
       <span class="pl-k">end</span>
ERROR<span class="pl-k">:</span> syntax<span class="pl-k">:</span> invalid spacing <span class="pl-k">in</span> left side of indexed assignment
 <span class="pl-k">in</span> eval 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">Removing the space in front of <code class="notranslate">-1</code> makes it work.</p>