Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
tabemann committed Feb 27, 2024
2 parents 811ae24 + 3e5e7dc commit be32b47
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 3 deletions.
Binary file modified epub/.doctrees/environment.pickle
Binary file not shown.
Binary file added epub/.doctrees/words/dynamic.doctree
Binary file not shown.
4 changes: 2 additions & 2 deletions epub/content.opf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<dc:publisher>Travis Bemann</dc:publisher>
<dc:rights>2020, Travis Bemann</dc:rights>
<dc:identifier id="unknown">unknown</dc:identifier>
<dc:date>2024-02-25T22:47:37Z</dc:date>
<meta property="dcterms:modified">2024-02-25T22:47:37Z</meta>
<dc:date>2024-02-26T21:08:41Z</dc:date>
<meta property="dcterms:modified">2024-02-26T21:08:41Z</meta>
<meta property="ibooks:version"></meta>
<meta property="ibooks:specified-fonts">true</meta>
<meta property="ibooks:binding">true</meta>
Expand Down
58 changes: 58 additions & 0 deletions epub/words/dynamic.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

<title>Dynamically-Scoped Variable Words</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/epub.css" />
</head><body>

<div class="document">
<div class="documentwrapper">
<div class="body" role="main">

<section id="dynamically-scoped-variable-words">
<h1>Dynamically-Scoped Variable Words</h1>
<p>Dynamically-scoped variables enable the definition of variables with a scope within a called execution token or within all execution inside a given thread except for within scopes in which they are redefined. Note that values of dynamically-scoped variables are specific to individual tasks, and do not exist for the main task on bootup or within new tasks on spawning.</p>
<section id="dynamic">
<h2><code class="docutils literal notranslate"><span class="pre">dynamic</span></code></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">dynamic</span></code> module contains the following words:</p>
<section id="dyn">
<h3><code class="docutils literal notranslate"><span class="pre">dyn</span></code></h3>
<p>( “name” – )</p>
<p>This defines a dynamically-scoped single-cell variable with the specified <em>name</em>. Note that this does not give it any value. If this is executed during compilation to flash the defined variable will persist across reboots.</p>
</section>
<section id="id1">
<h3><code class="docutils literal notranslate"><span class="pre">2dyn</span></code></h3>
<p>( “name” – )</p>
<p>This defines a dynamically-scoped double-cell variable with the specified <em>name</em>. Note that this does not give it any value. If this is executed during compilation to flash the defined variable will persist across reboots.</p>
</section>
<section id="id2">
<h3><code class="docutils literal notranslate"><span class="pre">dyn!</span></code></h3>
<p>( xt x|xd variable – )</p>
<p>This sets a dynamically-scoped variable <em>variable</em> to <em>x</em> or <em>xd</em> depending on whether it is single-cell or double-cell within the scope defined by the execution token <em>xt</em> within the current task. This temporarily uses space in the current task’s RAM dictionary to store the defined value of <em>variable</em>.</p>
</section>
<section id="dyn-no-scope">
<h3><code class="docutils literal notranslate"><span class="pre">dyn-no-scope!</span></code></h3>
<p>( x|xd variable – )</p>
<p>This sets a dynamically-scoped variable <em>variable</em> to <em>xt</em> or <em>xd</em> depending on whether it is single-cell or double-cell within the scope defined by all execution after this point within the current task until overridden by another execution of <code class="docutils literal notranslate"><span class="pre">dyn!</span></code> or <code class="docutils literal notranslate"><span class="pre">dyn-no-scope!</span></code>. Note that this permanently uses space in the current task’s RAM dictionary to store the defined value of <em>variable</em>; do not use this within implicit compilation.</p>
</section>
<section id="id3">
<h3><code class="docutils literal notranslate"><span class="pre">dyn&#64;</span></code></h3>
<p>( variable – x|xd )</p>
<p>This gets the current value of a dynamically-scoped variable <em>variable</em> within the current task as <em>x</em> or <em>xd</em> dependingon whether it is single-cell or double-cell.</p>
</section>
</section>
</section>


<div class="clearer"></div>
</div>
</div>
<div class="clearer"></div>
</div>
</body>
</html>
Binary file modified epub/zeptoforth.epub
Binary file not shown.
Binary file modified html/.doctrees/environment.pickle
Binary file not shown.
Binary file added html/.doctrees/words/dynamic.doctree
Binary file not shown.
32 changes: 32 additions & 0 deletions html/_sources/words/dynamic.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Dynamically-Scoped Variable Words

Dynamically-scoped variables enable the definition of variables with a scope within a called execution token or within all execution inside a given thread except for within scopes in which they are redefined. Note that values of dynamically-scoped variables are specific to individual tasks, and do not exist for the main task on bootup or within new tasks on spawning.

### `dynamic`

The `dynamic` module contains the following words:

##### `dyn`
( "name" -- )

This defines a dynamically-scoped single-cell variable with the specified *name*. Note that this does not give it any value. If this is executed during compilation to flash the defined variable will persist across reboots.

##### `2dyn`
( "name" -- )

This defines a dynamically-scoped double-cell variable with the specified *name*. Note that this does not give it any value. If this is executed during compilation to flash the defined variable will persist across reboots.

##### `dyn!`
( xt x|xd variable -- )

This sets a dynamically-scoped variable *variable* to *x* or *xd* depending on whether it is single-cell or double-cell within the scope defined by the execution token *xt* within the current task. This temporarily uses space in the current task's RAM dictionary to store the defined value of *variable*.

##### `dyn-no-scope!`
( x|xd variable -- )

This sets a dynamically-scoped variable *variable* to *xt* or *xd* depending on whether it is single-cell or double-cell within the scope defined by all execution after this point within the current task until overridden by another execution of `dyn!` or `dyn-no-scope!`. Note that this permanently uses space in the current task's RAM dictionary to store the defined value of *variable*; do not use this within implicit compilation.

##### `dyn@`
( variable -- x|xd )

This gets the current value of a dynamically-scoped variable *variable* within the current task as *x* or *xd* dependingon whether it is single-cell or double-cell.
2 changes: 1 addition & 1 deletion html/searchindex.js

Large diffs are not rendered by default.

Loading

0 comments on commit be32b47

Please sign in to comment.