all repos — min @ 0945bfc412bdd7cf53e37c9f0c74f4b9978728bc

A small but practical concatenative programming language.

Updated OpenSSL for windows, updated docs
h3rald h3rald@h3rald.com
Tue, 02 Mar 2021 20:02:55 +0100
commit

0945bfc412bdd7cf53e37c9f0c74f4b9978728bc

parent

6406ae6170e81656e711f2f5c5b9f62b73f289bb

M minpkg/lib/min_str.nimminpkg/lib/min_str.nim

@@ -49,15 +49,11 @@ i.push s[start..index].newVal

def.symbol("split") do (i: In): let vals = i.expect("'sym", "'sym") - let sep = vals[0].getString + let sep = re(vals[0].getString) let s = vals[1].getString var q = newSeq[MinValue](0) - if (sep == ""): - for c in s: - q.add ($c).newVal - else: - for e in s.split(sep): - q.add e.newVal + for e in s.split(sep): + q.add e.newVal i.push q.newVal def.symbol("join") do (i: In):
M next-release.mdnext-release.md

@@ -4,7 +4,9 @@ * No longer distributing lite and mini variants.

* Removed **regex** and **=~** symbols, use **search**, **replace**, **search-all**, **replace-apply** instead. * Regular expressions are PCRE compliant. * Renamed **match** into **match?**. +* The **split** operator now takes a PCRE as a separator. ### New features -* Now includng statically-compiled PCRE V8.44 library used for regular expression support. +* Now including statically-compiled PCRE V8.44 library used for regular expression support. +* Upgraded OpenSSL to v1.1.1j.
M site/contents/_defs_.mdsite/contents/_defs_.md

@@ -59,7 +59,7 @@ {{sock1 => [dict:socket<sub>1</sub>](class:kwd)}}

{{sock2 => [dict:socket<sub>2</sub>](class:kwd)}} {{m => _min_}} -{{sgregex => [sgregex](https://github.com/snake5/sgregex).}} +{{pcre => [Perl Compatible Regular Expression](https://www.pcre.org/)}} {#op => <a id="op-$1"></a>
M site/contents/home.mdsite/contents/home.md

@@ -6,7 +6,7 @@ <div class="pure-g">

<section class="pitch pure-u-1 pure-u-md-2-3"> <em>min</em> is 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<sup>*</sup>. + REPL. All packed in a single file. </section> <section class="centered pure-u-1 pure-u-md-1-3"> <a class="pure-button pure-button-primary" href="/get-started/"><i class="ti-download"></i> download min v{{$version}}</a><br />

@@ -22,15 +22,15 @@ <div class="pure-g">

<section class="pure-u-1 pure-u-md-1-2"> <h2>Features</h2> <ul> - <li>Entirely written in <a href="https://nim-lang.org">Nim</a>. It can be easily embedded in other nim programs.</li> + <li>Entirely written in <a href="https://nim-lang.org">Nim</a>. It can be easily embedded in other Nim programs.</li> <li>Follows the <strong>functional</strong> and <strong>concatenative</strong> programming paradigms.</li> <li>Provides a wide range of <strong>combinators</strong> for advanced stack manipulation and dequoting.</li> - <li>Provides a <strong>minimal set of data types</strong>: integer, floats, strings, booleans, and quotations (lists).</li> - <li>Fully <strong>homoiconic</strong>, all code can be accessed as data via quotations.</li> + <li>Provides a <strong>minimal set of data types</strong>: integer, floats, strings, booleans, dictionaries, and quotations (lists).</li> + <li><strong>Homoiconic</strong>, code can be accessed as data.</li> <li>Includes an <strong>advanced REPL</strong> with auto-completion and history management.</li> <li>Provides a lightweight <strong>module system</strong>.</li> <li>Provides <strong>sigils</strong> as syntactic sugar to access environment variables, quoting, defining and binding data, etc.</li> - <li>Includes a small, useful <strong>standard library</strong> for common tasks.</li> + <li>Includes a small but useful <strong>standard library</strong> for practical tasks.</li> <li>Self-contained, statically compiled into single file.</li> </ul> </section>

@@ -51,9 +51,4 @@ (dup 0 ==) (1 +)

(dup 1 -) (*) linrec</code> </pre> </section> -</div> -<div class="pure-g"> - <section class="pure-u-1"> - <small><sup>*</sup>: I used to boast that the min executable was around 1MB in size&#8230; well, that was before it statically linked OpenSSL!</small> - </section> -</div> +</div>
M site/contents/reference-str.mdsite/contents/reference-str.md

@@ -61,12 +61,12 @@

{#op||lowercase||{{sl}}||{{s}}|| Returns a copy of {{sl}} converted to lowercase.#} -{#op||match||{{s1}} {{s2}}||{{b}}|| +{#op||match?||{{s1}} {{s2}}||{{b}}|| > Returns {{t}} if {{s2}} matches {{s1}}, {{f}} otherwise. > > %tip% > > Tip > > -> > {{s2}} can be a {{sgregex}}-compatible regular expression.#} +> > {{s2}} is a {{pcre}}#}. {#op||ord||{{s}}||{{i}}|| Returns the ASCII code {{i}} corresponding to the single character {{s}}.#}

@@ -85,7 +85,7 @@ > Returns a copy of {{s1}} containing all occurrences of {{s2}} replaced by {{s3}}

> > %tip% > > Tip > > -> > {{s2}} can be a {{sgregex}}-compatible regular expression. +> > {{s2}} is a {{pcre}}. > > > %sidebar% > > Example

@@ -103,7 +103,7 @@ > Returns a copy of {{s1}} containing all occurrences of {{s2}} replaced by applying {{q}} to each quotation correponding to each match.

> > %tip% > > Tip > > -> > {{s2}} can be a {{sgregex}}-compatible regular expression. +> > {{s2}} is a {{pcre}}. > > > %sidebar% > > Example

@@ -122,46 +122,6 @@ > > ("-2-" "2")

> > ("-3-" "3") > > ("-4-" "4") #} -{#op||regex||{{s1}} {{s2}}||{{q}}|| -> Performs a search and/or a search-and-replace operation using pattern {{s2}}. -> -> {{s2}} can be one of the following patterns: -> -> * **/**_search-regex_**/**_modifiers_ -> * **s/**_search-regex_**/**_replacemenet_**/**_modifiers_ -> -> {{q}} is always a quotation containing: -> -> * One or more strings containing the first match and captures (if any), like for the `search` operator. -> * A string containing the resuling string after the search-and-replace operation. -> -> > %tip% -> > Tip -> > -> > * _search-regex_ can be a {{sgregex}}-compatible regular expression. -> > * _modifiers_ are optionals can contain one or more of the following characters, in any order: -> > * **i**: case-insensitive match. -> > * **m**: multi-line match. -> > * **s**: dot character includes newlines. -> -> > %sidebar% -> > Example: Search -> > -> > The following: -> > -> > `"This is a GOOD idea." "/(good) idea/i" regex` -> > -> > produces: `("GOOD idea", "GOOD")` -> -> > %sidebar% -> > Example: Search and Replace -> > -> > The following: -> > -> > `"This is a GOOD idea." "s/good/bad/i" regex` -> > -> > produces: `("This is a bad idea")`#} - {#op||search||{{s1}} {{s2}}||{{q}}|| > Returns a quotation containing the first occurrence of {{s2}} within {{s1}}. Note that: >

@@ -171,7 +131,7 @@ >

> > %tip% > > Tip > > -> > {{s2}} can be a {{sgregex}}-compatible regular expression. +> > {{s2}} is a {{pcre}}. > > > %sidebar% > > Example

@@ -198,7 +158,7 @@ {#op||semver?||{{s}}||{{b}}||

Checks whether {{s}} is a [SemVer](https://semver.org)-compliant version or not. #} {#op||split||{{sl1}} {{sl2}}||{{q}}|| -Splits {{sl1}} using separator {{sl2}} and returns the resulting strings within the quotation {{q}}. #} +Splits {{sl1}} using separator {{sl2}} (a {{pcre}}) and returns the resulting strings within the quotation {{q}}. #} {#op||strip||{{sl}}||{{s}}|| Returns {{s}}, which is set to {{sl}} with leading and trailing spaces removed.#}