<p dir="auto">Following the discussion on Slack.</p>
<p dir="auto">Currently this works :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; (1:2) - (1.0:2)
0.0:0.0:0.0"><pre class="notranslate"><code class="notranslate">julia&gt; (1:2) - (1.0:2)
0.0:0.0:0.0
</code></pre></div>
<p dir="auto">But these operations fail:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; (1:2) - (1:2)
ERROR: ArgumentError: step cannot be zero"><pre class="notranslate"><code class="notranslate">julia&gt; (1:2) - (1:2)
ERROR: ArgumentError: step cannot be zero
</code></pre></div>
<p dir="auto">and</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; (1:1:2) - (1:1:2)
ERROR: ArgumentError: step cannot be zero"><pre class="notranslate"><code class="notranslate">julia&gt; (1:1:2) - (1:1:2)
ERROR: ArgumentError: step cannot be zero
</code></pre></div>
<p dir="auto">It would be more consistent to allow them, but then internal design of <code class="notranslate">UnitRange</code> and <code class="notranslate">StepRange</code> would need to change (and a tricky part is that the length can span from <code class="notranslate">0</code> to <code class="notranslate">2^(sizeof(type)*8)</code> which is just one value too much to use the same storage type for values and for length).</p>
<p dir="auto">Additionally we have the following problems with ragne:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; a = 2^60
1152921504606846976

julia&gt; a:-a
1152921504606846976:1152921504606846975

julia&gt; BigFloat(a):BigFloat(-a)
ERROR: ArgumentError: length cannot be negative, got -2305843009213693951"><pre class="notranslate"><code class="notranslate">julia&gt; a = 2^60
1152921504606846976

julia&gt; a:-a
1152921504606846976:1152921504606846975

julia&gt; BigFloat(a):BigFloat(-a)
ERROR: ArgumentError: length cannot be negative, got -2305843009213693951
</code></pre></div>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="record_reference_images = true
recordpath = &quot;blah&quot;
if record_reference_images
   cd(homedir()) do
       isdir(dirname(recordpath)) || run(`git clone git@github.com:SimonDanisch/ReferenceImages.git`)
       isdir(recordpath) &amp;&amp; rm(recordpath)
   end
end"><pre class="notranslate">record_reference_images <span class="pl-k">=</span> <span class="pl-c1">true</span>
recordpath <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>blah<span class="pl-pds">"</span></span>
<span class="pl-k">if</span> record_reference_images
   <span class="pl-c1">cd</span>(<span class="pl-c1">homedir</span>()) <span class="pl-k">do</span>
       <span class="pl-c1">isdir</span>(<span class="pl-c1">dirname</span>(recordpath)) <span class="pl-k">||</span> <span class="pl-c1">run</span>(<span class="pl-s"><span class="pl-pds">`</span>git clone git@github.com:SimonDanisch/ReferenceImages.git<span class="pl-pds">`</span></span>)
       <span class="pl-c1">isdir</span>(recordpath) <span class="pl-k">&amp;&amp;</span> <span class="pl-c1">rm</span>(recordpath)
   <span class="pl-k">end</span>
<span class="pl-k">end</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Unreachable reached at 0x7f4bd800eda3

signal (4): Illegal instruction
in expression starting at no file:0
cd at ./file.jl:99
unknown function (ip: 0x7f4bd800edc5)
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1829
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:324
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:428
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:363 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:686
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:799
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f4be357ff2f)
unknown function (ip: 0x9)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:808
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:787
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/builtins.c:622
eval at ./boot.jl:319
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:85
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:117 [inlined]
#28 at ./task.jl:259
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1536 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:268
unknown function (ip: 0xffffffffffffffff)
Allocations: 263206 (Pool: 263125; Big: 81); GC: 0
Illegal instruction (core dumped)"><pre class="notranslate"><code class="notranslate">Unreachable reached at 0x7f4bd800eda3

signal (4): Illegal instruction
in expression starting at no file:0
cd at ./file.jl:99
unknown function (ip: 0x7f4bd800edc5)
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1829
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:324
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:428
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:363 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:686
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:799
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f4be357ff2f)
unknown function (ip: 0x9)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:808
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:787
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/builtins.c:622
eval at ./boot.jl:319
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:85
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:117 [inlined]
#28 at ./task.jl:259
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1536 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:268
unknown function (ip: 0xffffffffffffffff)
Allocations: 263206 (Pool: 263125; Big: 81); GC: 0
Illegal instruction (core dumped)
</code></pre></div>
<p dir="auto">Versioninfo:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">versioninfo</span>()
Julia Version <span class="pl-c1">1.0</span>.<span class="pl-c1">0</span>
Commit <span class="pl-c1">5</span>d4eaca0c9 (<span class="pl-c1">2018</span><span class="pl-k">-</span><span class="pl-c1">08</span><span class="pl-k">-</span><span class="pl-c1">08</span> <span class="pl-c1">20</span><span class="pl-k">:</span><span class="pl-c1">58</span> UTC)
Platform Info<span class="pl-k">:</span>
  OS<span class="pl-k">:</span> Linux (x86_64<span class="pl-k">-</span>pc<span class="pl-k">-</span>linux<span class="pl-k">-</span>gnu)
  CPU<span class="pl-k">:</span> <span class="pl-c1">Intel</span>(R) <span class="pl-c1">Core</span>(TM) i7<span class="pl-k">-</span><span class="pl-c1">8700</span>K CPU @ <span class="pl-c1">3.70</span>GHz
  WORD_SIZE<span class="pl-k">:</span> <span class="pl-c1">64</span>
  LIBM<span class="pl-k">:</span> libopenlibm
  LLVM<span class="pl-k">:</span> libLLVM<span class="pl-k">-</span><span class="pl-c1">6.0</span>.<span class="pl-c1">0</span> (ORCJIT, skylake)</pre></div>