all repos — min @ 585f8bd8af2f956c97dc8bc50ac113cec5a073cc

A small but practical concatenative programming language.

Moved % and / sigils to seq module; added ? sigil for dhas?.
h3rald h3rald@h3rald.com
Sat, 05 Aug 2017 15:08:00 +0200
commit

585f8bd8af2f956c97dc8bc50ac113cec5a073cc

parent

f6df66429eb302020b63dbe3f8d02ac8257e4a6b

M Min_DeveloperGuide.htmMin_DeveloperGuide.htm

@@ -4518,11 +4518,11 @@

<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.10.0/min_v0.10.0_macosx_x64.zip">min v0.10.0 for macOS (x64)</a></li> -<li><a href="https://github.com/h3rald/min/releases/download/v0.10.0/min_v0.10.0_windows_x64.zip">min v0.10.0 for Windows (x64)</a></li> -<li><a href="https://github.com/h3rald/min/releases/download/v0.10.0/min_v0.10.0_linux_x64.zip">min v0.10.0 for Linux (x64)</a></li> -<li><a href="https://github.com/h3rald/min/releases/download/v0.10.0/min_v0.10.0_linux_x86.zip">min v0.10.0 for Linux (x86)</a></li> -<li><a href="https://github.com/h3rald/min/releases/download/v0.10.0/min_v0.10.0_linux_arm.zip">min v0.10.0 for Linux (arm)</a></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.10.1/min_v0.10.1_macosx_x64.zip">min v0.10.1 for macOS (x64)</a></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.10.1/min_v0.10.1_windows_x64.zip">min v0.10.1 for Windows (x64)</a></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.10.1/min_v0.10.1_linux_x64.zip">min v0.10.1 for Linux (x64)</a></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.10.1/min_v0.10.1_linux_x86.zip">min v0.10.1 for Linux (x86)</a></li> +<li><a href="https://github.com/h3rald/min/releases/download/v0.10.1/min_v0.10.1_linux_arm.zip">min v0.10.1 for Linux (arm)</a></li> </ul>

@@ -4534,7 +4534,7 @@

<ol> <li>Download and install <a href="https://nim-lang.org">nim</a>.</li> <li>Download and build <a href="https://github.com/h3rald/nifty">Nifty</a>, and put the nifty executable somewhere in your <span class="kwd">$PATH</span>.</li> -<li>Clone the min <a href="https://github.com/h3rald/hastyscribe">repository</a>.</li> +<li>Clone the min <a href="https://github.com/h3rald/min">repository</a>.</li> <li>Navigate to the min repository local folder.</li> <li>Run <strong>nifty install</strong> to download min’s dependencies.</li> <li>Run <strong>nim c -d:release min.nim</strong>.</li>

@@ -4717,7 +4717,7 @@

<p>It is possible to define symbols using the <a href="#op-define"><code>define</code></a> symbol. The following min program defines a new symbol called square that duplicates the first element on the stack and multiplies the two elements:</p> -<pre><code> (dup *) square define +<pre><code> (dup *) "square" define </code></pre> <p>Besides symbols, min provides a set of predefined <em>sigils</em> for commonly-used symbols. For example, the previous definition could be rewritten as follows using sigils:</p>

@@ -5251,12 +5251,6 @@ <div class="operator"><p><span class="kwd"> ^ <strong>&rArr;</strong> call</span></p>

<p>See <a href="#op-call">call</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> dget</span></p> - -<p>See <a href="#op-dget">dget</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> bind</span></p>

@@ -5269,12 +5263,6 @@ <div class="operator"><p><span class="kwd"> @ <strong>&rArr;</strong> bind</span></p>

<p>See <a href="#op-bind">bind</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> dset</span></p> - -<p>See <a href="#op-dset">dset</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> save-symbol</span></p>

@@ -6039,6 +6027,24 @@ <p>Prepends <span class="kwd">a<sub>1</sub></span> to the quotation that follows it.</p></div>

<a name="<code>seq</code>-Module"></a> <h3><code>seq</code> Module<a href="#document-top" title="Go to top"></a></h3> + +<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> dget</span></p> + +<p>See <a href="#op-dget">dget</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> dhas?</span></p> + +<p>See <a href="#op-dhas?">dhas?</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> dset</span></p> + +<p>See <a href="#op-dset">dset</a>.</p></div> <p><a id="op-all?"></a> <span class="reference-title">all?</span></p>

@@ -7386,7 +7392,7 @@

<p>Encrypts or decrypts <span class="kwd">&apos;sym<sub>1</sub></span> using the Advanced Encryption Standard (AES), using <span class="kwd">&apos;sym<sub>2</sub></span> as password.</p></div> </div> <div id="footer"> - <p><span class="copy"></span> Fabio Cevasco &ndash; July 30, 2017</p> + <p><span class="copy"></span> Fabio Cevasco &ndash; August 5, 2017</p> <p><span>Powered by</span> <a href="https://h3rald.com/hastyscribe"><span class="hastyscribe"></span></a></p> </div> </div>
M lib/min_lang.nimlib/min_lang.nim

@@ -627,12 +627,6 @@

def.sigil("^") do (i: In): i.push("call".newSym) - def.sigil("/") do (i: In): - i.push("dget".newSym) - - def.sigil("%") do (i: In): - i.push("dset".newSym) - def.sigil(">") do (i: In): i.push("save-symbol".newSym)
M lib/min_seq.nimlib/min_seq.nim

@@ -344,4 +344,13 @@ let vals = i.expect("dict")

let d = vals[0] i.push i.values(d) + def.sigil("?") do (i: In): + i.push("dhas?".newSym) + + def.sigil("/") do (i: In): + i.push("dget".newSym) + + def.sigil("%") do (i: In): + i.push("dset".newSym) + def.finalize("seq")
M min.nimblemin.nimble

@@ -1,6 +1,6 @@

[Package] name = "min" -version = "0.10.0" +version = "0.10.1" author = "Fabio Cevasco" description = "A tiny concatenative programming language and shell." license = "MIT"
M min.vimmin.vim

@@ -11,11 +11,11 @@

setl iskeyword=@,36-39,+,-,/,*,.,:,~,!,48-57,60-65,94-95,192-255 setl iskeyword+=^ -syntax keyword minDefaultSymbol ! != $ & ' * + # - % ^ -> . .. / : < <= == => =~ > >= @ ROOT aes all? and any? append args ask atime bind bool boolean? call call! capitalize case cd chmod choose clear-stack cleave column-print concat confirm cons cp cpu crypto ctime datetime ddel debug decode define defined? delete dget dictionary? dip dir? dirname div dprint dprint! dset dup encode env? error eval even? exists? exit expect fappend fatal find file? filename filter first flatten float float? foreach fperms fread from-json format-error fs fsize fstats ftype fwrite get gets get-env get-stack hardlink harvest hidden? id if import in? indent indexof info insert int integer? interpolate interval io join keep keys length linrec load load-symbol logic loglevel loglevel? lowercase ls ls-r map map-reduce match md5 mkdir mod module module-symbols module-sigils mtime mv newline nip not notice now num number? odd? opts os over partition password pick pop popd pred prepend print print! prompt publish puts puts! put-env q quotation? quote quote-bind quote-define random raise reduce regex reject remove remove-symbol repeat replace rest reverse rm rmdir run save-symbol scope scope? seal search seq set set-stack sha1 sha224 sha256 sha384 sha512 shorten sigils sip size sleep slice sort source split spread stack startup stored-symbols str string string? strip succ sum swap swons symbols symlink symlink? sys system take tap tap! tformat time timeinfo times timestamp titleize to-json to-timestamp try dequote uppercase unzip values version warn when which while with xor zip +syntax keyword minDefaultSymbol ! != $ & ' * + # - % ^ -> . .. / : < <= == => =~ > >= @ ROOT aes all? and any? append args ask atime bind bool boolean? call call! capitalize case cd chmod choose clear-stack cleave column-print concat confirm cons cp cpu crypto ctime datetime ddel debug decode define defined? delete dget dhas? dictionary? dip dir? dirname div dprint dprint! dset dup encode env? error eval even? exists? exit expect fappend fatal find file? filename filter first flatten float float? foreach fperms fread from-json format-error fs fsize fstats ftype fwrite get gets get-env get-stack hardlink harvest hidden? id if import in? indent indexof info insert int integer? interpolate interval io join keep keys length linrec load load-symbol logic loglevel loglevel? lowercase ls ls-r map map-reduce match md5 mkdir mod module module-symbols module-sigils mtime mv newline nip not notice now num number? odd? opts os over partition password pick pop popd pred prepend print print! prompt publish puts puts! put-env q quotation? quote quote-bind quote-define random raise reduce regex reject remove remove-symbol repeat replace rest reverse rm rmdir run save-symbol scope scope? seal search seq set set-stack sha1 sha224 sha256 sha384 sha512 shorten sigils sip size sleep slice sort source split spread stack startup stored-symbols str string string? strip succ sum swap swons symbols symlink symlink? sys system take tap tap! tformat time timeinfo times timestamp titleize to-json to-timestamp try dequote uppercase unzip values version warn when which while with xor zip -syntax match minDefaultSigil ;\<[:@'~!$%&$=<>#^*#+/]; contained -syntax match minSpecialSymbols ;[:@'~!$%&$=<>#^*#+/]; contained +syntax match minDefaultSigil ;\<[:@'~!?$%&$=<>#^*#+/]; contained +syntax match minSpecialSymbols ;[:@'~!?$%&$=<>#^*#+/]; contained syntax match minQuote ;\<[']; syntax match minQuotedBinding ;#; syntax match minBinding ;@;

@@ -27,7 +27,7 @@ syntax match minNumber ;[-+]\=\d\+\(\.\d*\)\=;

syntax keyword minBoolean true false syntax region minString start=+"+ skip=+\\\\\|\\$"+ end=+"+ -syntax region minSigilSymbol start=;\<[:@'~!$%&$=<>^*#+/]; end=;\>; contains=minDefaultSigil +syntax region minSigilSymbol start=;\<[:@'~!?$%&$=<>^*#+/]; end=;\>; contains=minDefaultSigil syntax region minQuotedSymbol start=;\<[']; end=;\>; contains=minQuote syntax region minBoundSymbol start=;@; end=;\>; contains=minBinding syntax region minQuotedBoundSymbol start=;#; end=;\>; contains=minQuotedBinding
M site/contents/_includes/_reference-lang.mdsite/contents/_includes/_reference-lang.md

@@ -16,13 +16,9 @@ {#sig||^||call#}

{#alias||^||call#} -{#sig||/||dget#} - {#sig||@||bind#} {#alias||@||bind#} - -{#sig||%||dset#} {#sig||>||save-symbol#}
M site/contents/_includes/_reference-seq.mdsite/contents/_includes/_reference-seq.md

@@ -1,5 +1,11 @@

{@ _defs_.md || 0 @} +{#sig||/||dget#} + +{#sig||?||dhas?#} + +{#sig||%||dset#} + {#op||all?||{{q1}} {{q2}}||{{b}}|| Applies predicate {{q2}} to each element of {{q1}} and returns {{t}} if all elements of {{q1}} satisfy predicate {{q2}}, {{f}} otherwise. #}
M site/settings.jsonsite/settings.json

@@ -5,6 +5,6 @@ "templates": "templates",

"temp": "temp", "output": "output", "title": "min language", - "version": "0.10.0", + "version": "0.10.1", "rules": "rules.min" }