Skip to content

Commit

Permalink
Support outer joins in query
Browse files Browse the repository at this point in the history
Fixes #436.
  • Loading branch information
jclark committed Sep 12, 2020
1 parent 965c9b9 commit 5c8c68e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lang/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -5593,11 +5593,11 @@ <h4>Let clause</h4>

<section>
<h4>Join clause</h4>
<pre class="grammar">join-clause := <code>join</code> typed-binding-pattern <code>in</code> expression join-on-condition
<pre class="grammar">join-clause := [<code>outer</code>] <code>join</code> typed-binding-pattern <code>in</code> expression join-on-condition
join-on-condition := <code>on</code> expression <code>equals</code> expression
</pre>
<p>
A join clause performs an inner equijoin.
A join clause performs an inner or left outer equijoin.
</p>
<p>
A <code>join</code> clause is executed as follows:
Expand Down Expand Up @@ -5634,9 +5634,13 @@ <h4>Join clause</h4>
<li>let <var>fs</var> be the list of frames for key <var>k</var> in <var>m</var>;</li>
<li>for each frame <var>f'</var> in <var>fs</var>
<ul>
<li>emit a frame consisting of <var>f</var> augmented with <var>f'</var>.</li>
<li>emit a frame consisting of <var>f</var> augmented with <var>f'</var>;</li>
</ul>
</li>
<li>if <code>outer</code> was specified and <var>fs</var> is empty, then emit a
single frame consisting of <var>f</var> augmented with a frame that binds every
variable occurring in typed-binding-pattern to <code>()</code>.
</li>
</ul>
</li>
</ul>
Expand All @@ -5653,6 +5657,14 @@ <h4>Join clause</h4>
scope for the expression following <code>in</code>, nor for the expression on
the left of <code>equals</code>.
</p>
<p>
When <code>outer</code> is specified, the typed-binding-pattern is treated
specially: the inferable-type-descriptor in the typed-binding-pattern must be
<code>var</code>, and for each variable occurring in the typed-binding-pattern,
if the type that would be inferred usually for the variable would be
<var>T</var>, then the type inferred in this case will be
<var>T</var><code>?</code>.
</p>

</section>

Expand Down

0 comments on commit 5c8c68e

Please sign in to comment.