all repos — h3rald @ 180bc9485d0c696ee866373fd73f8c87915ae90f

The sources of https://h3rald.com

Updates
h3rald h3rald@h3rald.com
Sat, 02 Jan 2021 22:10:53 +0000
commit

180bc9485d0c696ee866373fd73f8c87915ae90f

parent

1fe304364055b68ac82a6d9fa991ac559fa3c41f

2 files changed, 165 insertions(+), 114 deletions(-)

jump to
M assets/min/Min_DeveloperGuide.htmassets/min/Min_DeveloperGuide.htm

@@ -7286,7 +7286,7 @@ <li><a href="#Using-nimble">Using nimble</a></li>

<li><a href="#Without-using-nimble">Without using nimble</a></li> <li><a href="#Additional-build-options">Additional build options</a> <ul> - <li><a href="#-d:ssl">-d:ssl</a></li> + <li><a href="#-d:ssl-(enabled-by-default)">-d:ssl (enabled by default)</a></li> <li><a href="#-d:lite">-d:lite</a></li> <li><a href="#-d:mini">-d:mini</a> </li>

@@ -7350,7 +7350,6 @@ <ul>

<li><a href="#Implementing-new-min-modules-using-min-itself">Implementing new min modules using min itself</a></li> <li><a href="#Specifying-your-custom-prelude-program">Specifying your custom prelude program</a></li> <li><a href="#Embedding-min-in-your-Nim-program">Embedding min in your Nim program</a></li> - <li><a href="#Implementing-min-modules-as-dynamic-libraries">Implementing min modules as dynamic libraries</a></li> </ul> </li> <li><a href="#Reference">Reference</a>

@@ -7410,9 +7409,9 @@ <p>Because creating a programming language is something that every programmer needs to do, at some point in life. And also because there are way too few <a href="http://concatenative.org/wiki/view/Front%20Page">concatenative</a> programming language out there &ndash; so people are likely to be <em>less</em> pissed off than if I made a yet another Lisp instead.</p>

<p>I always wanted to build a minimalist language, but that could also be used for real work and provided a standard library for common tasks and functionalities like regular expression support, cryptography, execution of external programs, shell-like operators, and keywords to work with files, and more.</p> -<p>Also, I wanted it to be fully self-contained, cross-platform, and tiny. About 1MB (depending on the platform) is not really tiny, but I feel it&rsquo;s a good compromise compared to the alternatives out there, considering that you only need <em>one file</em> to run any min program.</p> +<p>Additionally, I wanted it to be fully self-contained, cross-platform, and tiny. About 1MB (or more, depending on the platform and whether SSL support is enabled or not) is not really tiny, but I feel it&rsquo;s a good compromise compared to the alternatives out there, considering that you only need <em>one file</em> to run any min program.</p> -<p>I am currently building a static site generator called <a href="https://github.com/h3rald/hastysite">HastySite</a>, which also powers <a href="https://min-lang.org">https://min-lang.org</a>. HastySite internally uses min as the language to write the <a href="https://github.com/h3rald/min/blob/master/site/rules.min">rules</a> to process the source files of the site, and also all its <a href="https://github.com/h3rald/min/tree/master/site/scripts">scripts</a>.</p> +<p> I also created a static site generator called <a href="https://github.com/h3rald/hastysite">HastySite</a>, which also powers <a href="https://min-lang.org">https://min-lang.org</a>. HastySite internally uses min as the language to write the <a href="https://github.com/h3rald/min/blob/master/site/rules.min">rules</a> to process the source files of the site, and also all its <a href="https://github.com/h3rald/min/tree/master/site/scripts">scripts</a>.</p> <p>Finally, I think more and more people should get to know concatenative programming languages, because <a href="http://evincarofautumn.blogspot.it/2012/02/why-concatenative-programming-matters.html">concatenative programming matters</a>.</p>

@@ -7441,9 +7440,9 @@

<p>You can download one of the following pre-built min binaries:</p> <ul> -<li><a href="https://github.com/h3rald/min/releases/download/v0.26.0/min_v0.26.0_macosx_x64.zip">min v0.26.0 for macOS (x64)</a> <small>[<a href="https://github.com/h3rald/min/releases/download/v0.26.0/litemin_v0.26.0_macosx_x64.zip">lite</a>, <a href="https://github.com/h3rald/min/releases/download/v0.26.0/minimin_v0.26.0_macosx_x64.zip">mini</a>]</small></li> -<li><a href="https://github.com/h3rald/min/releases/download/v0.26.0/min_v0.26.0_windows_x64.zip">min v0.26.0 for Windows (x64)</a> <small>[<a href="https://github.com/h3rald/min/releases/download/v0.26.0/litemin_v0.26.0_windows_x64.zip">lite</a>, <a href="https://github.com/h3rald/min/releases/download/v0.26.0/minimin_v0.26.0_windows_x64.zip">mini</a>]</small></li> -<li><a href="https://github.com/h3rald/min/releases/download/v0.26.0/min_v0.26.0_linux_x64.zip">min v0.26.0 for Linux (x64)</a> <small>[<a href="https://github.com/h3rald/min/releases/download/v0.26.0/litemin_v0.26.0_linux_x64.zip">lite</a>, <a href="https://github.com/h3rald/min/releases/download/v0.26.0/minimin_v0.26.0_linux_x64.zip">mini</a>]</small></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.27.1/min_v0.27.1_macosx_x64.zip">min v0.27.1 for macOS (x64)</a> <small>[<a href="https://github.com/h3rald/min/releases/download/v0.27.1/litemin_v0.27.1_macosx_x64.zip">lite</a>, <a href="https://github.com/h3rald/min/releases/download/v0.27.1/minimin_v0.27.1_macosx_x64.zip">mini</a>]</small></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.27.1/min_v0.27.1_windows_x64.zip">min v0.27.1 for Windows (x64)</a> <small>[<a href="https://github.com/h3rald/min/releases/download/v0.27.1/litemin_v0.27.1_windows_x64.zip">lite</a>, <a href="https://github.com/h3rald/min/releases/download/v0.27.1/minimin_v0.27.1_windows_x64.zip">mini</a>]</small></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.27.1/min_v0.27.1_linux_x64.zip">min v0.27.1 for Linux (x64)</a> <small>[<a href="https://github.com/h3rald/min/releases/download/v0.27.1/litemin_v0.27.1_linux_x64.zip">lite</a>, <a href="https://github.com/h3rald/min/releases/download/v0.27.1/minimin_v0.27.1_linux_x64.zip">mini</a>]</small></li> </ul>

@@ -7475,8 +7474,8 @@

<a name="Additional-build-options"></a> <h4>Additional build options<a href="#document-top" title="Go to top"></a></h4> -<a name="-d:ssl"></a> -<h5>-d:ssl<a href="#document-top" title="Go to top"></a></h5> +<a name="-d:ssl-(enabled-by-default)"></a> +<h5>-d:ssl (enabled by default)<a href="#document-top" title="Go to top"></a></h5> <p>If the <strong>-d:ssl</strong> flag is specified when compiling, min will be built with SSL support, so it will be possible to: * perform HTTPS requests with the <a href="#&lt;code>http&lt;/code>-Module">http Module</a>.

@@ -7484,7 +7483,7 @@ * use the cryptographic symbols defined in the <a href="#&lt;code>crypto&lt;/code>-Module">crypto Module</a>.</p>

<div class="note"><p>Note</p> -<p>By default, this flag is enabled when compiling the executable files included with official releases.</p></div> +<p>By default, this flag is enabled in the <span class="file">min.nims</span>. use <strong>-d:nossl</strong> to disable it.</p></div> <a name="-d:lite"></a> <h5>-d:lite<a href="#document-top" title="Go to top"></a></h5>

@@ -7612,9 +7611,9 @@ <p>If you want to pass any options to the Nim compiler (like <code>-d:release</code> for example) you can do so by using the <code>-n</code> (or <code>--passN</code>) option:</p>

<div class="min-terminal"><p><span class="prompt">$</span> min -c myfile.min -n:-d:release</p></div> -<p>Additionally, you can also use <code>-m:&lt;path&gt;</code> (or <code>--module-path</code>) to specify one path containing <span class="ext">.min</span> files which will be compiled as well (but not executed) along with the specified file. Whenever a <a href="#min-operator-id-load">load</a> symbol is used to load an external <span class="ext">.min</span> file, it will attempt to load from the pre-loaded files first before searching the filesystem.</p> +<p>Additionally, you can also use <code>-m:&lt;path&gt;</code> (or <code>--module-path</code>) to specify one path containing <span class="ext">.min</span> files which will be compiled as well (but not executed) along with the specified file. Whenever a <a href="#min-operator-id-load">load</a> or a <a href="#min-operator-id-require">require</a> symbol is used to load/require an external <span class="ext">.min</span> file, it will attempt to retrieve its contents from the pre-loaded files first before searching the filesystem.</p> -<p>For example, the following command executed in the root folder of the min project will compile <span class="file">run.min</span> along with all <span class="ext">.min</span> files included in the <span class="dir">task</span> and its subfolders:</p> +<p>For example, the following command executed in the root folder of the min project will compile <span class="file">run.min</span> along with all <span class="ext">.min</span> files included in the <span class="dir">tasks</span> folder and its subfolders:</p> <div class="min-terminal"><p><span class="prompt">$</span> min -c run.min -m:tasks</p></div>

@@ -7802,7 +7801,18 @@

<pre><code> (dup *) "square" define </code></pre> -<p>Besides symbols, you can also define sigila. min provides a set of predefined <em>sigils</em> as abbreviations for for commonly-used symbols. For example, the previous definition could be rewritten as follows using sigils:</p> +<p>Now, while the <a href="#min-operator-id-define">define</a> symbol can be fine to define (the equivalent of) variables and simple operators, it is typically better to use the <a href="#min-operator-id-operator">operator</a> symbol instead, as it provides better readability, additional checks and automatic input/output capturing. The previous <code>square</code> symbol could also be defined like this:</p> + +<pre><code> ( + symbol square + (num :n ==&gt; num :result) + (n dup * @result) + ) operator +</code></pre> + +<p>In this case, note how inputs and outputs are captured into the <code>n</code> and <code>result</code> symbols in the signature quotation and then referenced in the body quotation. Sure, the original version was much more succinct, but this is definitely more readable.</p> + +<p>Besides symbols, you can also define sigils. min provides a set of predefined <em>sigils</em> as abbreviations for for commonly-used symbols. For example, the previous definition could be rewritten as follows using sigils:</p> <pre><code> (dup *) :square </code></pre>

@@ -8267,12 +8277,12 @@ <h2>Extending min<a href="#document-top" title="Go to top"></a></h2>

<p>min provides a fairly complete standard library with many useful modules. However, you may feel the need to extend min in order to perform more specialized tasks.</p> -<p>In such situations, you basically have three options:</p> +<p>In such situations, you basically have the following options:</p> <ul> -<li>Implement new min modules in min</li> -<li>Embed min in your <a href="https://nim-lang.org">Nim</a> program</li> -<li>Implemet min modules as dynamic libraries in Nim</li> +<li>Implementing new min modules using min itself</li> +<li>Specifying your custom prelude program</li> +<li>Embedding min in your <a href="https://nim-lang.org">Nim</a> program</li> </ul>

@@ -8388,73 +8398,6 @@ <div class="tip"><p>Tip</p>

<p>For more information on how to create new modules with Nim, have a look in the <a href="https://github.com/h3rald/min/tree/master/lib">lib folder</a> of the min repository, which contains all the min modules included in the standard library.</p></div> -<a name="Implementing-min-modules-as-dynamic-libraries"></a> -<h3>Implementing min modules as dynamic libraries<a href="#document-top" title="Go to top"></a></h3> - -<div class="warning"><p>Warning</p> - -<p>This technique is currently highly experimental, it has not been tested extensively and it may not even work properly.</p></div> - -<p>If you just want to add a new module to min providing functinalities that cannot be built natively with min operators, you can also implement a min module in Nim and compile it to a dynamic library which can be linked dynamically when min is started.</p> - -<p>In order to do this, you don&rsquo;t even need to download the whole min source code, you just need to download the <a href="https://github.com/h3rald/min/blob/master/mindyn.nim">mindyn.nim</a> file and import it in your Nim program.</p> - -<p>The following code shows how to create a simple min module called <em>dyntest</em> containing only a single operator <em>dynplus</em>, which essentially returns the sum of two numbers:</p> - -<pre><code>import mindyn - -proc dyntest*(i: In) {.dynlib, exportc.} = - - let def = i.define() - - def.symbol("dynplus") do (i: In): - let vals = i.expect("num", "num") - let a = vals[0] - let b = vals[1] - if a.isInt: - if b.isInt: - i.push newVal(a.intVal + b.intVal) - else: - i.push newVal(a.intVal.float + b.floatVal) - else: - if b.isFloat: - i.push newVal(a.floatVal + b.floatVal) - else: - i.push newVal(a.floatVal + b.intVal.float) - - def.finalize("dyntest") -</code></pre> - -<p>Note that the <code>mindym.nim</code> file contains the signatures of all the <code>proc</code>s that are commonly used to define min modules, but not their implementation. Such <code>proc</code>s will become available at run time when the dynamic library is linked to the min executable.</p> - -<p>You can compile the following library by running the following command:</p> - -<div class="min-terminal"><p><span class="prompt">$</span> nim c --app:lib -d:release \ ---noMain dyntest.nim</p></div> - -<p>If you are using <a href="https://clang.llvm.org/">clang</a> to compile Nim code, you may need to run the following command instead:</p> - -<div class="min-terminal"><p><span class="prompt">$</span> nim c --app:lib -d:release --noMain \ --l:&#34;-undefined dynamic_lookup&#34; dyntest.nim</p></div> - -<p>Now you should have a <code>libdyntest.so|dyn|dll</code> file. To make min load it and link it automatically when it starts, just run:</p> - -<div class="min-terminal"><p><span class="prompt">$</span> min --install:libdyntest.dyn</p></div> - -<p>This command will copy the library file to <code>$HOME/.minlibs/</code> (<code>%HOMEPATH%\.minlibs\</code> on Windows). min looks for dynamic libraries in this folder when it starts.</p> - -<div class="note"><p>Notes</p> - -<ul> -<li>The dynamic library file must have the same name as the module it defines (<em>dyntest</em> in this case).</li> -<li>At startup, min links all your installed dynamic libraries but does not import the modules automatically.</li> -</ul> -</div> - -<p>If you wish to uninstall the library, run the following command instead:</p> - -<div class="min-terminal"><p><span class="prompt">$</span> min --uninstall:libdyntest.dyn</p></div> - <a name="Reference"></a> <h2>Reference<a href="#document-top" title="Go to top"></a></h2>

@@ -8535,7 +8478,7 @@ "h3rald" :hostname

"" :port "" :username "" :password - "min" :path + "/min" :path "" :anchor "" :query }

@@ -8671,6 +8614,12 @@ <div class="operator"><p><span class="kwd"> : <strong>&rArr;</strong> define</span></p>

<p>See <a href="#min-operator-id-define">define</a>.</p></div> +<p><span class="reference-title">::</span></p> + +<div class="operator"><p><span class="kwd"> :: <strong>&rArr;</strong> operator</span></p> + +<p>See <a href="#min-operator-id-operator">operator</a>.</p></div> + <p><span class="reference-title">~</span> <span class="sigil"></span></p> <div class="operator"><p><span class="kwd"> ~<span class="kwd">string</span> <strong>&rArr;</strong> <span class="kwd">string</span> delete</span></p>

@@ -8731,9 +8680,9 @@ <div class="operator"><p><span class="kwd"> -> <strong>&rArr;</strong> dequote</span></p>

<p>See <a href="#min-operator-id-dequote">dequote</a>.</p></div> -<p><span class="reference-title">&ndash;</span></p> +<p><span class="reference-title">--</span></p> -<div class="operator"><p><span class="kwd"> &ndash; <strong>&rArr;</strong> reverse-expect-dequote</span></p> +<div class="operator"><p><span class="kwd"> -- <strong>&rArr;</strong> reverse-expect-dequote</span></p> <p>See <a href="#min-operator-id-reverse-expect-dequote">reverse-expect-dequote</a>.</p></div>

@@ -8754,6 +8703,13 @@

<div class="operator"><p><span class="kwd"> => <strong>&rArr;</strong> apply</span></p> <p>See <a href="#min-operator-id-apply">apply</a>.</p></div> + +<p><a id="min-operator-id-==>&ldquo;></a> +<span class="reference-title">==></span></p> + +<div class="operator"><p><span class="kwd"> &#x2205; <strong>&rArr;</strong> &#x2205;</span></p> + +<p>Symbol used to separate input and output calues in operator signatures.</p></div> <p><span class="reference-title">=-=</span></p>

@@ -9176,6 +9132,56 @@ <div class="operator"><p><span class="kwd"> <span class="kwd">dict</span> <span class="kwd">&apos;sym</span> <strong>&rArr;</strong> &#x2205;</span></p>

<p>Creates a new module <span class="kwd">&apos;sym</span> based on dictionary <span class="kwd">dict</span>.</p></div> +<p><a id="min-operator-id-operator"></a> +<span class="reference-title">operator</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">quot</span> <strong>&rArr;</strong> <span class="kwd">a<sub>*</sub></span></span></p> + +<p>Provides a way to define a new operator (symbol or sigil) on the current scope performing additional checks (compared to <code>define</code> and <code>define-sigil</code>), and automatically mapping inputs and outputs.</p> + +<p><span class="kwd">quot</span> is a quotation containing:</p> + +<ul> +<li>A symbol identifying the type of operator to define (<code>symbol</code> or <code>sigil</code>).</li> +<li>A symbol identifying the name of the operator.</li> +<li>A quotation defining the signature of the operatorm containing input and output values identified by their type and a capturing symbol, separated by the <code>==&gt;</code> symbol.</li> +<li>A quotation identifying the body of the operator.</li> +</ul> + + +<p>The main additional features offered by this way of defining operators are the following:</p> + +<ul> +<li>Both input and output values are checked against a type (like when using the <code>expect</code> operator <em>and</em> automatically captured in a symbol that can be referenced in the operator body quotation.</li> +<li>The full signature of the operator is declared, making the resulting code easier to understand at quick glance.</li> +<li>An exception is automatically raised if the operator body pollutes the stack by adding or removing elementa from the stack (besides adding the declared output values).</li> +<li>It is possible to use the <code>return</code> symbol within the body quotation to immediately stop the evaluation of the body quotation and automatically push the output values on the stack.</li> +</ul> + + +<div class="sidebar"><p>Example</p> + +<p>The following program defines a <code>pow</code> operator that calculates the power of a number providing its base and exponent, and handling some NaN results using the <code>return</code> symbol:</p> + +<pre><code> ( + symbol pow + (num :base int :exp ==&gt; num :result) + ( + (base 0 == exp 0 == and) + (nan @result return) + when + (base 1 == exp inf == and) + (nan @result return) + when + (base inf == exp 0 == and) + (nan @result return) + when + exp 1 - :n + base (dup) n times (*) n times @result + ) + ) :: +</code></pre></div></div> + <p><a id="min-operator-id-opts"></a> <span class="reference-title">opts</span></p>

@@ -9305,14 +9311,22 @@ <div class="operator"><p><span class="kwd"> <span class="kwd">quot<sub>1</sub></span> <strong>&rArr;</strong> <span class="kwd">a<sub>*</sub></span></span></p>

<p>Validates the first <em>n</em> elements of the stack against the type descriptions specified in <span class="kwd">quot<sub>1</sub></span> (<em>n</em> is <span class="kwd">quot<sub>1</sub></span>&rsquo;s length) in reverse order and if all the elements are valid restores them on the stack.</p> -<p>%sidebar% -Example</p> +<div class="sidebar"><p>Example</p> <p>The following program maps the three values on the stack to three symbols, after validating them:</p> <pre><code>1 3.5 true (int float bool) -- :my-int :my-float :my-bool -</code></pre></div> +</code></pre></div></div> + +<p><a id="min-operator-id-return"></a> +<span class="reference-title">return</span></p> + +<div class="operator"><p><span class="kwd"> &#x2205; <strong>&rArr;</strong> &#x2205;</span></p> + +<p>If used within the body quotation of an operator definition, causes the interpreter to stop pushing further body elements on the stack and start pushing tbe operator output values on the stack.</p></div> + +<p>If used outside of the body quotation of an operator definition, it raises an exception.</p> <p><a id="min-operator-id-ROOT"></a> <span class="reference-title">ROOT</span></p>

@@ -9323,8 +9337,7 @@ <p>Returns a module holding a reference to the <span class="kwd">ROOT</span> scope.</p>

<div class="tip"><p>Tip</p> -<p>This symbol is very useful in conjunction with the <strong>with</strong> operator. -#</p></div></div> +<p>This symbol is very useful in conjunction with the <strong>with</strong> operator.</p></div></div> <p><a id="min-operator-id-save-symbol"></a> <span class="reference-title">save-symbol</span></p>

@@ -9607,9 +9620,7 @@ 'net import

'http import ) ROOT with ) unless -</code></pre> - -<p>#</p></div></div> +</code></pre></div></div> <a name="<code>stack</code>-Module"></a> <h3><code>stack</code> Module<a href="#document-top" title="Go to top"></a></h3>

@@ -10162,16 +10173,14 @@ <span class="reference-title">dsdelete</span></p>

<div class="operator"><p><span class="kwd"> <span class="kwd">dict:datastore</span> <span class="kwd">&apos;sym</span> <strong>&rArr;</strong> <span class="kwd">dict:datastore</span></span></p> -<p>Removes an item from the datastore <span class="kwd">dict:datastore</span>. The item is uniquely identified by <span class="kwd">&apos;sym</span>, which contains the collection containing the item and the item id, separated by a forward slash (/). Puts the reference to the modified datastore back on tbe stack. -#</p></div> +<p>Removes an item from the datastore <span class="kwd">dict:datastore</span>. The item is uniquely identified by <span class="kwd">&apos;sym</span>, which contains the collection containing the item and the item id, separated by a forward slash (/). Puts the reference to the modified datastore back on tbe stack.</p></div> <p><a id="min-operator-id-dsget"></a> <span class="reference-title">dsget</span></p> <div class="operator"><p><span class="kwd"> <span class="kwd">dict:datastore</span> <span class="kwd">&apos;sym</span> <strong>&rArr;</strong> <span class="kwd">dict</span></span></p> -<p>Retrieves item <span class="kwd">dict</span> from datastore <span class="kwd">dict:datastore</span>. <span class="kwd">dict</span> is retrieved by specifying <span class="kwd">&apos;sym</span>, which contains the collection containing the item and the item id, separated by a forward slash (/). -#</p></div> +<p>Retrieves item <span class="kwd">dict</span> from datastore <span class="kwd">dict:datastore</span>. <span class="kwd">dict</span> is retrieved by specifying <span class="kwd">&apos;sym</span>, which contains the collection containing the item and the item id, separated by a forward slash (/).</p></div> <p><a id="min-operator-id-dsinit"></a> <span class="reference-title">dsinit</span></p>

@@ -10185,16 +10194,14 @@ <span class="reference-title">dspost</span></p>

<div class="operator"><p><span class="kwd"> <span class="kwd">dict:datastore</span> <span class="kwd">&apos;sym</span> <span class="kwd">dict</span> <strong>&rArr;</strong> <span class="kwd">dict:datastore</span></span></p> -<p>Adds the dictionary <span class="kwd">dict</span> to the datastore <span class="kwd">dict:datastore</span> inside collection <span class="kwd">&apos;sym</span>, generating and adding a unique <strong>id</strong> field to <span class="kwd">dict</span>. If the collection <span class="kwd">&apos;sym</span> does not exist it is created. Puts the reference to the modified datastore back on tbe stack. -#</p></div> +<p>Adds the dictionary <span class="kwd">dict</span> to the datastore <span class="kwd">dict:datastore</span> inside collection <span class="kwd">&apos;sym</span>, generating and adding a unique <strong>id</strong> field to <span class="kwd">dict</span>. If the collection <span class="kwd">&apos;sym</span> does not exist it is created. Puts the reference to the modified datastore back on tbe stack.</p></div> <p><a id="min-operator-id-dsput"></a> <span class="reference-title">dsput</span></p> <div class="operator"><p><span class="kwd"> <span class="kwd">dict:datastore</span> <span class="kwd">&apos;sym</span> <span class="kwd">dict</span> <strong>&rArr;</strong> <span class="kwd">dict:datastore</span></span></p> -<p>Adds the dictionary <span class="kwd">dict</span> to the datastore <span class="kwd">dict:datastore</span>. <span class="kwd">&apos;sym</span> contains the collection where <span class="kwd">dict</span> will be placed and the id of <span class="kwd">dict</span>, separated by a forward slash (/). If the collection <span class="kwd">&apos;sym</span> does not exist it is created. Puts the reference to the modified datastore back on tbe stack. -#</p></div> +<p>Adds the dictionary <span class="kwd">dict</span> to the datastore <span class="kwd">dict:datastore</span>. <span class="kwd">&apos;sym</span> contains the collection where <span class="kwd">dict</span> will be placed and the id of <span class="kwd">dict</span>, separated by a forward slash (/). If the collection <span class="kwd">&apos;sym</span> does not exist it is created. Puts the reference to the modified datastore back on tbe stack.</p></div> <p><a id="min-operator-id-dsquery"></a> <span class="reference-title">dsquery</span></p>

@@ -10208,25 +10215,21 @@

<p>Assuming that <strong>ds</strong> is a datastore, the following program retrieves all elements of teh collection <strong>posts</strong> whose author field is set to &ldquo;h3rald&rdquo;:</p> <pre><code> ds "posts" (/author "h3rald" ==) dsquery -</code></pre> - -<p>#</p></div></div> +</code></pre></div></div> <p><a id="min-operator-id-dsread"></a> <span class="reference-title">dsread</span></p> <div class="operator"><p><span class="kwd"> <span class="kwd">&apos;sym</span> <strong>&rArr;</strong> <span class="kwd">dict:datastore</span></span></p> -<p>Reads the previously-created datastore from the file <span class="kwd">&apos;sym</span> and puts the resulting datastore instance on the stack. -#</p></div> +<p>Reads the previously-created datastore from the file <span class="kwd">&apos;sym</span> and puts the resulting datastore instance on the stack.</p></div> <p><a id="min-operator-id-dswrite"></a> <span class="reference-title">dswrite</span></p> <div class="operator"><p><span class="kwd"> <span class="kwd">dict:datastore</span> <strong>&rArr;</strong> <span class="kwd">dict:datastore</span></span></p> -<p>Writes the contents of the datastore <span class="kwd">dict:datastore</span> to the filesystem. -#</p></div> +<p>Writes the contents of the datastore <span class="kwd">dict:datastore</span> to the filesystem.</p></div> <a name="<code>io</code>-Module"></a> <h3><code>io</code> Module<a href="#document-top" title="Go to top"></a></h3>

@@ -10282,12 +10285,26 @@ <div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> <span class="kwd">a</span></span></p>

<p>Prints <span class="kwd">a</span> and a new line to STDOUT, if logging level is set to <span class="kwd">debug</span> or lower.</p></div> +<p><a id="min-operator-id-debug!"></a> +<span class="reference-title">debug!</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> &#x2205;</span></p> + +<p>Prints <span class="kwd">a</span> (removing it from the stack) and a new line to STDOUT, if logging level is set to <span class="kwd">debug</span> or lower.</p></div> + <p><a id="min-operator-id-error"></a> <span class="reference-title">error</span></p> <div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> <span class="kwd">a</span></span></p> <p>Prints <span class="kwd">a</span> and a new line to STDERR, if logging level is set to <span class="kwd">error</span> or lower.</p></div> + +<p><a id="min-operator-id-error!"></a> +<span class="reference-title">error!</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> &#x2205;</span></p> + +<p>Prints <span class="kwd">a</span> (removing it from the stack) and a new line to STDERR, if logging level is set to <span class="kwd">error</span> or lower.</p></div> <p><a id="min-operator-id-fappend"></a> <span class="reference-title">fappend</span></p>

@@ -10331,6 +10348,13 @@ <div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> <span class="kwd">a</span></span></p>

<p>Prints <span class="kwd">a</span> and a new line to STDOUT, if logging level is set to <span class="kwd">info</span> or lower.</p></div> +<p><a id="min-operator-id-info!"></a> +<span class="reference-title">info!</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> &#x2205;</span></p> + +<p>Prints <span class="kwd">a</span> (removing it from the stack) and a new line to STDOUT, if logging level is set to <span class="kwd">info</span> or lower.</p></div> + <p><a id="min-operator-id-mapkey"></a> <span class="reference-title">mapkey</span></p>

@@ -10368,6 +10392,13 @@

<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> <span class="kwd">a</span></span></p> <p>Prints <span class="kwd">a</span> and a new line to STDOUT, if logging level is set to <span class="kwd">notice</span> (default) or lower.</p></div> + +<p><a id="min-operator-id-notice!"></a> +<span class="reference-title">notice!</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> &#x2205;</span></p> + +<p>Prints <span class="kwd">a</span> (removing it from the stack) and a new line to STDOUT, if logging level is set to <span class="kwd">notice</span> (default) or lower.</p></div> <p><a id="min-operator-id-password"></a> <span class="reference-title">password</span></p>

@@ -10415,8 +10446,7 @@ <div class="note"><p>Notes</p>

<ul> <li>At present, only the key names and sequences defined in the <a href="https://h3rald.com/nimline/nimline.html">nimline</a> library are supported.</li> -<li>At present, all the default mappings of min are those provided by the <a href="https://h3rald.com/nimline/nimline.html">nimline</a> library. -#</li> +<li>At present, all the default mappings of min are those provided by the <a href="https://h3rald.com/nimline/nimline.html">nimline</a> library.</li> </ul> </div></div>

@@ -10426,6 +10456,13 @@

<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> <span class="kwd">a</span></span></p> <p>Prints <span class="kwd">a</span> and a new line to STDERR, if logging level is set to <span class="kwd">warning</span> or lower.</p></div> + +<p><a id="min-operator-id-warning!"></a> +<span class="reference-title">warning!</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> &#x2205;</span></p> + +<p>Prints <span class="kwd">a</span> (removing it from the stack) and a new line to STDERR, if logging level is set to <span class="kwd">warning</span> or lower.</p></div> <a name="<code>fs</code>-Module"></a> <h3><code>fs</code> Module<a href="#document-top" title="Go to top"></a></h3>

@@ -10641,6 +10678,20 @@

<div class="operator"><p><span class="kwd"> <span class="kwd">a</span> <strong>&rArr;</strong> <span class="kwd">bool</span></span></p> <p>Returns <span class="kwd">true</span> if <span class="kwd">a</span> is a dictionary, <span class="kwd">false</span> otherwise.</p></div> + +<p><a id="min-operator-id-expect-all"></a> +<span class="reference-title">expect-all</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">quot</span> <strong>&rArr;</strong> <span class="kwd">bool</span></span></p> + +<p>Assuming that <span class="kwd">quot</span> is a quotation of quotations each evaluating to a boolean value, it pushes <span class="kwd">true</span> on the stack if they all evaluate to <span class="kwd">true</span>, <span class="kwd">false</span> otherwise.</p></div> + +<p><a id="min-operator-id-expect-any"></a> +<span class="reference-title">expect-any</span></p> + +<div class="operator"><p><span class="kwd"> <span class="kwd">quot</span> <strong>&rArr;</strong> <span class="kwd">bool</span></span></p> + +<p>Assuming that <span class="kwd">quot</span> is a quotation of quotations each evaluating to a boolean value, it pushes <span class="kwd">true</span> on the stack if any evaluates to <span class="kwd">true</span>, <span class="kwd">false</span> otherwise.</p></div> <p><a id="min-operator-id-float?"></a> <span class="reference-title">float?</span></p>

@@ -11971,7 +12022,7 @@

<p>Stops the currently-running HTTP server. This operator should be used within an HTTP server handler quotation.</p></div> </div> <div id="footer"> - <p><span class="copy"></span> Fabio Cevasco &ndash; December 25, 2020</p> + <p><span class="copy"></span> Fabio Cevasco &ndash; January 2, 2021</p> <p><span>Powered by</span> <a href="https://h3rald.com/hastyscribe"><span class="hastyscribe"></span></a></p> </div> </div>
M contents/min.mdcontents/min.md

@@ -9,7 +9,7 @@ summary: "A functional, concatenative programming language with a minimalist syntax, a small but practical standard library, and an advanced REPL. All packed in a single file."

content-type: project active: true download: "https://github.com/h3rald/min/releases/download/" -version: 0.26.0 +version: 0.27.1 docs: /min/Min_DeveloperGuide.htm -----