<div dir="ltr"><div class="gmail_extra">One thing that bothered me though is that the keyword 'auto' was reused simply because... it was there. There's nothing "auto" going on in any sense of the word.</div><div class="gmail_extra"><br></div><div class="gmail_extra">This can be fixed though. I guess I may go to hell for it, but I found a magic trick:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><font face="monospace, monospace" color="#741b47">#define let auto</font></div><div class="gmail_extra"><br></div><div class="gmail_extra">together with custom syntax highlighting rules making <span style="color:rgb(191,144,0);font-family:monospace,monospace">let</span> a statement (and <span style="color:rgb(106,168,79);font-family:monospace,monospace">auto</span> a type rather than a storage specifier, for the rare case you need it).</div><div class="gmail_extra"><br></div><div class="gmail_extra">Watch it in action:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-family:monospace,monospace"><font color="#bf9000">let</font> frobnicate( <font color="#6aa84f">int</font> x ) -> <font color="#6aa84f">int</font> { ... }</span><br></div><div class="gmail_extra"><font face="monospace, monospace"><br></font></div><div class="gmail_extra"><font face="monospace, monospace"><font color="#bf9000">let constexpr</font> addone( <font color="#6aa84f">auto</font> x ) {  <font color="#bf9000">return</font> x+1;  }  <font color="#3d85c6">// g++ extension I think?</font></font></div><div class="gmail_extra"><br class="">And it works excellently for initialized variable declarations as well:<font face="monospace, monospace"><br></font></div><div class="gmail_extra"><br></div><div class="gmail_extra"><font face="monospace, monospace"><font color="#bf9000">let</font> x = <font color="#a64d79">42</font>;</font></div><div class="gmail_extra"><font face="monospace, monospace"><font color="#bf9000">let const</font> debug = <font color="#a64d79">false</font>;</font></div><div class="gmail_extra"><font face="monospace, monospace"><br></font></div><div class="gmail_extra"><span style="font-family:monospace,monospace"><font color="#bf9000">for</font>( <font color="#bf9000">let</font> &x : things ) { ... }</span><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Annoyingly not everything can be written like this, although after a while of writing in this style, the inconsistency of exceptions have actually become an eye-sore to the point I'd now sooner write</div><div class="gmail_extra"><font face="monospace, monospace"><font color="#bf9000">let</font> i = <font color="#6aa84f">u64</font> {};</font></div><div class="gmail_extra">than</div><div class="gmail_extra"><font face="monospace, monospace"><font color="#6aa84f">u64</font> i;</font></div><div class="gmail_extra">even though I'm normally a fan of conciseness.</div><div class="gmail_extra"><br></div><div class="gmail_extra">You can admire this and other horrible coding sins in some actual code e.g. here:</div><div class="gmail_extra">  <a href="https://github.com/dutchanddutch/jbang/blob/master/src/hw-subarctic.cc">https://github.com/dutchanddutch/jbang/blob/master/src/hw-subarctic.cc</a></div><div class="gmail_extra">though without the custom syntax highlighting rules it can't be fully appreciated.</div><div class="gmail_extra"><br></div><div class="gmail_extra">*runs for cover* ;-)</div><div class="gmail_extra"><br></div><div class="gmail_extra">Matthijs</div></div>