Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
rpeach-sag committed May 3, 2018
1 parent f29f388 commit 7c0e5e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The deployment script provides a way to make Lambdas for EPL globally available
1. From SoftwareAG Designer right click on your project in `Project Explorer`
2. Select `Apama` from the drop down menu;
3. Select `Add Bundle`
4. Scroll down to `Standard bundles` and select `Lambdas for EPL`
4. Scroll down to `LAMBDAS_HOME/bundles` and select `Lambdas for EPL`
5. Click `Ok`

When run via Designer, it will automatically inject all of the dependencies.
Expand Down Expand Up @@ -174,6 +174,7 @@ Calling actions in a generic way is not possible in Apama 10.1, so only a handfu
| `.pow(n)`|Call on any numeric type to raise it to the `n`^th^ power |
| `.sqrt()`|Call on any numeric type to square root the value |
|`.getTypeName()`|Call on any type to get its type name as a string |

**Sequence Literals**
Sequences can be constructed in lambdas in much the same way that they can in EPL, except that they are always `sequence<any>`.
```javascript
Expand All @@ -182,7 +183,7 @@ Lambda.function1("x => [x, x + 1, x + 2]")(0) = [<any>0, 1, 2]
**Spread Operator**
The spread operator expands a sequence inside another sequence:
```javascript
Lambda.function1("x => [...x, 3, 4, 5])([0, 1, 2]) = [<any>0, 1, 2, 3, 4, 5]
Lambda.function1("x => [...x, 3, 4, 5]")([0, 1, 2]) = [<any>0, 1, 2, 3, 4, 5]
```
**Array Destructuring**
When using lambdas (particularly with Observables) you may find that a lambda is provided with a sequence as the argument. Rather than accessing each value using `seq[index]` it is easier to assign a name to each item in the sequence:
Expand Down
4 changes: 2 additions & 2 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h3 id="adding-to-a-project">2. Adding to a Project</h3>
<li>From SoftwareAG Designer right click on your project in <code>Project Explorer</code></li>
<li>Select <code>Apama</code> from the drop down menu;</li>
<li>Select <code>Add Bundle</code></li>
<li>Scroll down to <code>Standard bundles</code> and select <code>Lambdas for EPL</code></li>
<li>Scroll down to <code>LAMBDAS_HOME/bundles</code> and select <code>Lambdas for EPL</code></li>
<li>Click <code>Ok</code></li>
</ol>
<p>When run via Designer, it will automatically inject all of the dependencies.</p>
Expand Down Expand Up @@ -209,7 +209,7 @@ <h2 id="a-idlanguagealanguage-features"><a id="language"></a>Language Features</
</code></pre>
<p><strong>Spread Operator</strong><br>
The spread operator expands a sequence inside another sequence:</p>
<pre class=" language-javascript"><code class="prism language-javascript">Lambda<span class="token punctuation">.</span><span class="token function">function1</span><span class="token punctuation">(</span>"x <span class="token operator">=&gt;</span> <span class="token punctuation">[</span><span class="token operator">...</span>x<span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token operator">&lt;</span>any<span class="token operator">&gt;</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span>
<pre class=" language-javascript"><code class="prism language-javascript">Lambda<span class="token punctuation">.</span><span class="token function">function1</span><span class="token punctuation">(</span><span class="token string">"x =&gt; [...x, 3, 4, 5]"</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token operator">&lt;</span>any<span class="token operator">&gt;</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span>
</code></pre>
<p><strong>Array Destructuring</strong><br>
When using lambdas (particularly with Observables) you may find that a lambda is provided with a sequence as the argument. Rather than accessing each value using <code>seq[index]</code> it is easier to assign a name to each item in the sequence:</p>
Expand Down

0 comments on commit 7c0e5e1

Please sign in to comment.