Skip to content

Commit

Permalink
fixup! Lift restrictions for matching of binaries and maps
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Dec 9, 2022
1 parent 27a6c9a commit fe049b3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion system/doc/reference_manual/expressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ value
3> <input>f(Key), #{Key := Value} = (#{key := Key} = M), Value.</input>
value
4> <input>f(Key), (#{Key := Value} = #{key := Key}) = M, Value.</input>
* 1:12: variable 'Key' is unbound</pre>
* 1:12: variable 'Key' is unbound
5> <input>&lt;&lt;X:Y&gt;&gt; = begin Y = 8, &lt;&lt;42:8&gt;&gt; end, X.</input>
42</pre>

<p>The expression at prompt <em>2&gt;</em> first matches the value of
variable <c>M</c> against pattern <c>#{key := Key}</c>, binding
Expand All @@ -307,6 +309,13 @@ value
sub patterns are matched at the same time, and the variable
<c>Key</c> is therefore not bound when matching against pattern
<c>#{Key := Value}</c>.</p>

<p>In the expression at prompt <em>5&gt;</em> the expressions
inside the <seeguide marker="#block_expressions">block
expression</seeguide> are evaluated first, binding variable
<c>Y</c> and creating a binary. The binary is then matched
against pattern <c>&lt;&lt;X:Y&gt;&gt;</c> using the value of
<c>Y</c> as the size of the segment.</p>
</section>

<section>
Expand Down Expand Up @@ -1767,6 +1776,7 @@ end</code>
</section>

<section>
<marker id="block_expressions"></marker>
<title>Block Expressions</title>
<pre>
begin
Expand Down

0 comments on commit fe049b3

Please sign in to comment.