<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Questions without answers in Syntax and reader</title>
<link>https://ask.clojure.org/index.php/unanswered/clojure/reader</link>
<description></description>
<item>
<title>Octal escape sequence decoding in strings does not stop at non-octal digit</title>
<link>https://ask.clojure.org/index.php/14846/octal-escape-sequence-decoding-strings-does-stop-octal-digit</link>
<description>&lt;p&gt;Strings suppose to support standard Java escape sequences, including octal escape sequence: [0-7]{1,3} &lt;/p&gt;
&lt;p&gt;In Java decoding of octal sequences stop at the first non-octal digit or any other character if there are 1 or two octal digits in the escape sequence. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jshell&amp;gt; &quot;\18&quot;
$1 ==&amp;gt; &quot;\0018&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But Clojure reads up to 3 potentially octal digits greedily resulting in wrongly consuming non-octal digits:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.4
user=&amp;gt; &quot;\18&quot;
Syntax error reading source at (REPL:1:5).
Invalid digit: 8
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;non-octal characters:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.4
user=&amp;gt; &quot;\1d&quot;
Syntax error reading source at (REPL:1:5).
Invalid digit: d
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And succeed only when there is line terminator or exact three octal digits in supported octal range:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.12.4
user=&amp;gt; &quot;\1&quot;
&quot;&quot;
user=&amp;gt; &quot;\1&quot;
&quot;&quot;
user=&amp;gt; &quot;\12&quot;
&quot;\n&quot;
user=&amp;gt; &quot;\123&quot;
&quot;S&quot;
user=&amp;gt; &quot;\123d&quot;
&quot;Sd&quot;
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14846/octal-escape-sequence-decoding-strings-does-stop-octal-digit</guid>
<pubDate>Thu, 18 Dec 2025 09:35:53 +0000</pubDate>
</item>
<item>
<title>Associative destructuring with if-let</title>
<link>https://ask.clojure.org/index.php/14574/associative-destructuring-with-if-let</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I'm surprised by the result of this code :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(if-let [{errors :errors} {}]
    errors
    true) =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I would have expected the result to be 'true'.&lt;/p&gt;
&lt;p&gt;As indicated by the result, 'errors' evaluates to nil, but still it's the 'then' arm of the 'if' that is evaluated.&lt;/p&gt;
&lt;p&gt;The guide on destructuring state that &quot;You can utilize destructuring anywhere that there is an explicit or implicit let binding.&quot;, so I'm a bit puzzled.&lt;/p&gt;
&lt;p&gt;Please, enlighten me. Thanks !&lt;/p&gt;
</description>
<category>Syntax and reader</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14574/associative-destructuring-with-if-let</guid>
<pubDate>Sat, 07 Jun 2025 17:21:45 +0000</pubDate>
</item>
</channel>
</rss>