all repos — min @ 7d3416891c57dc9319a659aba3d5fa66ce0f570c

A small but practical concatenative programming language.

Added zippy, removed conditional flags for variants.
h3rald h3rald@h3rald.com
Mon, 15 Mar 2021 19:34:05 +0100
commit

7d3416891c57dc9319a659aba3d5fa66ce0f570c

parent

780ed061a9fc8ccfcd83aa61dbbc99a0bacb1850

M README.mdREADME.md

@@ -1,7 +1,7 @@

<p align="center"><img align="center" width="350" src="logo.svg"/></p> <p align="center"> - <b>A tiny concatenative<br>programming language and shell</b> + <b>A small but practical<br>concatenative programming language and shell</b> <br><br> <img src="https://img.shields.io/badge/nim-powered-yellow.svg?link=https://nim-lang-org"> <img src="https://img.shields.io/github/release/h3rald/min/all.svg">
M help.jsonhelp.json

@@ -89,13 +89,13 @@ "kind": "symbol",

"name": "::" }, "<": { - "description": "Returns true if a1 is smaller than a2, false otherwise. \n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is smaller than a2, false otherwise. \r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": "<", "signature": "a1 a2 ==> bool" }, "<=": { - "description": "Returns true if a1 is smaller than or equal to a2, false otherwise.\n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is smaller than or equal to a2, false otherwise.\r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": "<=", "signature": "a1 a2 ==> bool"

@@ -133,7 +133,7 @@ "kind": "symbol",

"name": "=~" }, ">": { - "description": "Returns true if a1 is greater than a2, false otherwise. \n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is greater than a2, false otherwise. \r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": ">", "signature": "a1 a2 ==> bool"

@@ -144,7 +144,7 @@ "kind": "symbol",

"name": "><" }, ">=": { - "description": "Returns true if a1 is greater than or equal to a2, false otherwise.\n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is greater than or equal to a2, false otherwise.\r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": ">=", "signature": "a1 a2 ==> bool"

@@ -165,7 +165,7 @@ "kind": "symbol",

"name": "@" }, "ROOT": { - "description": "Returns a module holding a reference to the [ROOT](class:kwd) scope.\n\n \n Tip\n \n This symbol is very useful in conjunction with the **with** operator.", + "description": "Returns a module holding a reference to the [ROOT](class:kwd) scope.\r\n\r\n \r\n Tip\r\n \r\n This symbol is very useful in conjunction with the **with** operator.", "kind": "symbol", "name": "ROOT", "signature": " ==> dict"

@@ -302,7 +302,7 @@ "name": "bitxor",

"signature": "int1 int2 ==> int3" }, "bool": { - "description": "Converts a to a boolean value based on the following rules:\n \n * If a is a boolean value, no conversion is performed.\n * If a is null, it is converted to false .\n * If a is a numeric value, zero is converted to false , otherwise it is converted to true.\n * If a is a quotation or a dictionary, the empty quotation or dictionary is converted to false , otherwise it is converted to true.\n * If a is a string, the empty string, and \"false\" are converted to false , otherwise it is converted to true.", + "description": "Converts a to a boolean value based on the following rules:\r\n \r\n * If a is a boolean value, no conversion is performed.\r\n * If a is null, it is converted to false .\r\n * If a is a numeric value, zero is converted to false , otherwise it is converted to true.\r\n * If a is a quotation or a dictionary, the empty quotation or dictionary is converted to false , otherwise it is converted to true.\r\n * If a is a string, the empty string, and \"false\" are converted to false , otherwise it is converted to true.", "kind": "symbol", "name": "bool", "signature": "a ==> bool"

@@ -320,7 +320,7 @@ "name": "capitalize",

"signature": "'sym ==> str" }, "case": { - "description": "This operator takes a quotation containing _n_ different conditional branches. \n \n Each branch must be a quotation containing two quotations, and it is processed as follows:\n \n * if quot1 evaluates to true, then the quot2 is executed.\n * if quot1 evaluates to false , then the following branch is processed (if any).\n \n \n Example\n \n The following program prints \"Smaller than 3\":\n \n 2 (\n (( 3) (\"Greater than 3\" put!))\n ((< 3) (\"Smaller than 3\" put!))\n ((true) (\"Exactly 3\" put!))\n ) case", + "description": "This operator takes a quotation containing _n_ different conditional branches. \r\n \r\n Each branch must be a quotation containing two quotations, and it is processed as follows:\r\n \r\n * if quot1 evaluates to true, then the quot2 is executed.\r\n * if quot1 evaluates to false , then the following branch is processed (if any).\r\n \r\n \r\n Example\r\n \r\n The following program prints \"Smaller than 3\":\r\n \r\n 2 (\r\n (( 3) (\"Greater than 3\" put!))\r\n ((< 3) (\"Smaller than 3\" put!))\r\n ((true) (\"Exactly 3\" put!))\r\n ) case", "kind": "symbol", "name": "case", "signature": "((quot1 quot2)*) ==> a*"

@@ -338,13 +338,13 @@ "name": "ceil",

"signature": "num ==> int" }, "chmod": { - "description": "Sets the permissions of file or directory 'sym to int. int is a three-digit representation of user, group and other permissions. See the [Unix Permissions Calculator](http://permissions-calculator.org/) for examples and conversions.\n \n \n Example\n \n The following program makes the file **/tmp/test.txt** readable, writable and executable by its owner, and readable and executable by users of the same group and all other users:\n \n /tmp/test.txt 755 chmod", + "description": "Sets the permissions of file or directory 'sym to int. int is a three-digit representation of user, group and other permissions. See the [Unix Permissions Calculator](http://permissions-calculator.org/) for examples and conversions.\r\n \r\n \r\n Example\r\n \r\n The following program makes the file **/tmp/test.txt** readable, writable and executable by its owner, and readable and executable by users of the same group and all other users:\r\n \r\n /tmp/test.txt 755 chmod", "kind": "symbol", "name": "chmod", "signature": "'sym int ==> " }, "choose": { - "description": "Prints str2, then prints all str1 included in the quotation prepended with a number, and waits from valid input from the user.\n \n If the user enters a number that matches one of the choices, then the corresponding quotation quot1 is executed, otherwise the choice menu is displayed again until a valid choice is made.", + "description": "Prints str2, then prints all str1 included in the quotation prepended with a number, and waits from valid input from the user.\r\n \r\n If the user enters a number that matches one of the choices, then the corresponding quotation quot1 is executed, otherwise the choice menu is displayed again until a valid choice is made.", "kind": "symbol", "name": "choose", "signature": "((str1 quot1)+) str2 ==> a*"

@@ -368,7 +368,7 @@ "name": "clear-stack",

"signature": "a ==> " }, "cleave": { - "description": "Applies each quotation contained in the first element to the second element a1.\n \n Example\n \n The following program leaves 2 on the stack:\n \n (1 2 3) ((sum) (size)) cleave /", + "description": "Applies each quotation contained in the first element to the second element a1.\r\n \r\n Example\r\n \r\n The following program leaves 2 on the stack:\r\n \r\n (1 2 3) ((sum) (size)) cleave /", "kind": "symbol", "name": "cleave", "signature": "a1 (quot*) ==> a*"

@@ -398,13 +398,13 @@ "name": "concat",

"signature": "quot1 quot2 ==> quot3" }, "confirm": { - "description": "Prints str (prompt) appending \" [yes/no]: \", reads a line from STDIN and:\n \n * if it matches /^y(es)?$/i, puts true on the stack.\n * if it matches /^no?$/i, puts false on the stack. \n * Otherwise, it prints Invalid answer. Please enter 'yes' or 'no': and waits for a new answer.", + "description": "Prints str (prompt) appending \" [yes/no]: \", reads a line from STDIN and:\r\n \r\n * if it matches /^y(es)?$/i, puts true on the stack.\r\n * if it matches /^no?$/i, puts false on the stack. \r\n * Otherwise, it prints Invalid answer. Please enter 'yes' or 'no': and waits for a new answer.", "kind": "symbol", "name": "confirm", "signature": "str ==> bool" }, "connect": { - "description": "Connects socket dict:socket to address str and port int.\n \n \n Example\n \n The following code shows how to send a message to a server running on localhost:7777. The message is passed as the first argument to the program.\n \n {} socket \"localhost\" 7777 connect =cli\n \n args 1 get :msg\n \n \"Sending message \\\"$1\\\" to localhost:7777...\" (msg) = send\n \n \"Done.\" puts!\n \n cli close", + "description": "Connects socket dict:socket to address str and port int.\r\n \r\n \r\n Example\r\n \r\n The following code shows how to send a message to a server running on localhost:7777. The message is passed as the first argument to the program.\r\n \r\n {} socket \"localhost\" 7777 connect =cli\r\n \r\n args 1 get :msg\r\n \r\n \"Sending message \\\"$1\\\" to localhost:7777...\" (msg) = send\r\n \r\n \"Done.\" puts!\r\n \r\n cli close", "kind": "symbol", "name": "connect", "signature": "dict:socket str int ==> dict:socket"

@@ -512,7 +512,7 @@ "name": "delete-sigil",

"signature": "'sym ==> " }, "dequote": { - "description": "Pushes the contents of quotation quot on the stack.\n\n Each element is pushed on the stack one by one. If any error occurs, quot is restored on the stack.", + "description": "Pushes the contents of quotation quot on the stack.\r\n\r\n Each element is pushed on the stack one by one. If any error occurs, quot is restored on the stack.", "kind": "symbol", "name": "dequote", "signature": "quot ==> a*"

@@ -524,7 +524,7 @@ "name": "dget",

"signature": "dict 'sym ==> a" }, "dhas?": { - "description": "Returns true if dictionary dict contains the key 'sym, false otherwise.\n \n \n Example\n \n The following program returns true:\n \n {true :a1 \"aaa\" :a2 false :a3} 'a2 dhas?", + "description": "Returns true if dictionary dict contains the key 'sym, false otherwise.\r\n \r\n \r\n Example\r\n \r\n The following program returns true:\r\n \r\n {true :a1 \"aaa\" :a2 false :a3} 'a2 dhas?", "kind": "symbol", "name": "dhas?", "signature": "dict 'sym ==> bool"

@@ -536,7 +536,7 @@ "name": "dictionary?",

"signature": "a ==> bool" }, "difference": { - "description": "Calculates the difference quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (2) on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) difference", + "description": "Calculates the difference quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (2) on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) difference", "kind": "symbol", "name": "difference", "signature": "quot1 quot2 ==> quot3"

@@ -584,7 +584,7 @@ "name": "dpairs",

"signature": "dict ==> (a*)" }, "dpick": { - "description": "Returns a new dictionary dict2 containing the elements of dict1 whose keys are included in quot.\n \n \n Example\n \n The following program returns {4 :a 7 :d}:\n \n {5 :q 4 :a 6 :c 7 :d \"d\" :a} (\"a\" \"d\") dpick", + "description": "Returns a new dictionary dict2 containing the elements of dict1 whose keys are included in quot.\r\n \r\n \r\n Example\r\n \r\n The following program returns {4 :a 7 :d}:\r\n \r\n {5 :q 4 :a 6 :c 7 :d \"d\" :a} (\"a\" \"d\") dpick", "kind": "symbol", "name": "dpick", "signature": "dict1 quot ==> dict2"

@@ -632,7 +632,7 @@ "name": "dsput",

"signature": "dict:datastore 'sym dict ==> dict:datastore" }, "dsquery": { - "description": "Retrieves a quotation of dictionaries from the collection 'sym of datastore dict:datastore obtained by applying quot as a filter to each item of the collection, picking only the elements that match the filter.\n\n \n Example\n\n Assuming that **ds** is a datastore, the following program retrieves all elements of teh collection **posts** whose author field is set to \"h3rald\":\n\n ds \"posts\" (/author \"h3rald\" ==) dsquery", + "description": "Retrieves a quotation of dictionaries from the collection 'sym of datastore dict:datastore obtained by applying quot as a filter to each item of the collection, picking only the elements that match the filter.\r\n\r\n \r\n Example\r\n\r\n Assuming that **ds** is a datastore, the following program retrieves all elements of teh collection **posts** whose author field is set to \"h3rald\":\r\n\r\n ds \"posts\" (/author \"h3rald\" ==) dsquery", "kind": "symbol", "name": "dsquery", "signature": "dict:datastore 'sym quot ==> (dict*)"

@@ -722,7 +722,7 @@ "name": "exit",

"signature": "int ==> " }, "expect": { - "description": "Validates the first _n_ elements of the stack against the type descriptions specified in quot1 (_n_ is quot1's length) and if all the elements are valid returns them wrapped in quot2 (in reverse order). \n\n \n Tips\n \n * You can specify a typed dictionary by prepending the type name with dict:. Example: dict:socket\n * You can specify two or more matching types by separating combined together in a logical type expression, e.g.: string|quot\n\n \n Example\n \n Assuming that the following elements are on the stack (from top to bottom): \n \n 1 \"test\" 3.4\n \n the following program evaluates to true:\n \n (int string num) expect (3.4 \"test\" 1) ==", + "description": "Validates the first _n_ elements of the stack against the type descriptions specified in quot1 (_n_ is quot1's length) and if all the elements are valid returns them wrapped in quot2 (in reverse order). \r\n\r\n \r\n Tips\r\n \r\n * You can specify a typed dictionary by prepending the type name with dict:. Example: dict:socket\r\n * You can specify two or more matching types by separating combined together in a logical type expression, e.g.: string|quot\r\n\r\n \r\n Example\r\n \r\n Assuming that the following elements are on the stack (from top to bottom): \r\n \r\n 1 \"test\" 3.4\r\n \r\n the following program evaluates to true:\r\n \r\n (int string num) expect (3.4 \"test\" 1) ==", "kind": "symbol", "name": "expect", "signature": "quot1 ==> quot2"

@@ -770,13 +770,13 @@ "name": "filename",

"signature": "'sym ==> str" }, "filter": { - "description": "Returns a new quotation quot3 containing all elements of quot1 that satisfy predicate quot2.\n \n \n Example\n \n The following program leaves (2 6 8 12) on the stack:\n \n (1 37 34 2 6 8 12 21) \n (dup 20 < swap even? and) filter", + "description": "Returns a new quotation quot3 containing all elements of quot1 that satisfy predicate quot2.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (2 6 8 12) on the stack:\r\n \r\n (1 37 34 2 6 8 12 21) \r\n (dup 20 < swap even? and) filter", "kind": "symbol", "name": "filter", "signature": "quot1 quot2 ==> quot3" }, "find": { - "description": "Returns the index of the first element within quot1 that satisfies predicate quot2, or -1 if no element satisfies it.\n \n \n Example\n \n The following program leaves 3 on the stack:\n \n (1 2 4 8 16) \n (5 ) find", + "description": "Returns the index of the first element within quot1 that satisfies predicate quot2, or -1 if no element satisfies it.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 3 on the stack:\r\n \r\n (1 2 4 8 16) \r\n (5 ) find", "kind": "symbol", "name": "find", "signature": "quot1 quot2 ==> int"

@@ -788,13 +788,13 @@ "name": "first",

"signature": "quot ==> a" }, "flatten": { - "description": "Flattens all quotations within quot1 and returns the resulting sequence quot2.\n \n \n Example\n \n The following program leaves (1 2 3 4 5 6 7 8) on the stack:\n \n (1 (2 3 4) 5 (6 7) 8) \n flatten", + "description": "Flattens all quotations within quot1 and returns the resulting sequence quot2.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 2 3 4 5 6 7 8) on the stack:\r\n \r\n (1 (2 3 4) 5 (6 7) 8) \r\n flatten", "kind": "symbol", "name": "flatten", "signature": "quot1 ==> quot2" }, "float": { - "description": "Converts a to a float value based on the following rules:\n \n * If a is true, it is converted to 1.0.\n * If a is false , it is converted to 0.0.\n * If a is null, it is converted to 0.0\n. * If a is a integer, it is converted to float value.\n * If a is a float, no conversion is performed.\n * If a is a string, it is parsed as a float value.", + "description": "Converts a to a float value based on the following rules:\r\n \r\n * If a is true, it is converted to 1.0.\r\n * If a is false , it is converted to 0.0.\r\n * If a is null, it is converted to 0.0\r\n. * If a is a integer, it is converted to float value.\r\n * If a is a float, no conversion is performed.\r\n * If a is a string, it is parsed as a float value.", "kind": "symbol", "name": "float", "signature": "a ==> flt"

@@ -818,7 +818,7 @@ "name": "foreach",

"signature": "quot1 quot2 ==> a*" }, "format-error": { - "description": "Formats the error dict:error as a string. \n \n Example\n \n The following code: \n \n (\n (\n {\"MyError\" :error \"This is a test error\" :message} raise\n ) \n (format-error)\n ) try\n \n produces: \"This is a test error\"", + "description": "Formats the error dict:error as a string. \r\n \r\n Example\r\n \r\n The following code: \r\n \r\n (\r\n (\r\n {\"MyError\" :error \"This is a test error\" :message} raise\r\n ) \r\n (format-error)\r\n ) try\r\n \r\n produces: \"This is a test error\"", "kind": "symbol", "name": "format-error", "signature": "dict:error ==> str"

@@ -842,13 +842,13 @@ "name": "from-json",

"signature": "str ==> a" }, "from-semver": { - "description": "Given a basic [SemVer](https://semver.org)-compliant string (with no additional labels) str, \nit pushes a dictionary dict on the stack containing a **major**, **minor**, and **patch** key/value pairs.", + "description": "Given a basic [SemVer](https://semver.org)-compliant string (with no additional labels) str, \r\nit pushes a dictionary dict on the stack containing a **major**, **minor**, and **patch** key/value pairs.", "kind": "symbol", "name": "from-semver", "signature": "str ==> dict" }, "from-yaml": { - "description": "Converts a YAML string into min data.\n \n Note\n \n At present, only YAML objects containing string values are supported.", + "description": "Converts a YAML string into min data.\r\n \r\n Note\r\n \r\n At present, only YAML objects containing string values are supported.", "kind": "symbol", "name": "from-yaml", "signature": "str ==> a"

@@ -860,7 +860,7 @@ "name": "fsize",

"signature": "'sym ==> int" }, "fstats": { - "description": "Returns a dictionary dict containing information on file/directory 'sym.\n \n Example\n \n Assuming that min is a file, the following:\n \n \"min\" fstats\n \n produces:\n \n {\n \"min\" :name\n 16777220 :device\n 50112479 :file\n \"file\" :type\n 617068 :size\n 755 :permissions\n 1 :nlinks\n 1496583112.0 :ctime\n 1496584370.0 :atime\n 1496583112.0 :mtime\n }", + "description": "Returns a dictionary dict containing information on file/directory 'sym.\r\n \r\n Example\r\n \r\n Assuming that min is a file, the following:\r\n \r\n \"min\" fstats\r\n \r\n produces:\r\n \r\n {\r\n \"min\" :name\r\n 16777220 :device\r\n 50112479 :file\r\n \"file\" :type\r\n 617068 :size\r\n 755 :permissions\r\n 1 :nlinks\r\n 1496583112.0 :ctime\r\n 1496584370.0 :atime\r\n 1496583112.0 :mtime\r\n }", "kind": "symbol", "name": "fstats", "signature": "'sym ==> dict"

@@ -920,7 +920,7 @@ "name": "hardlink",

"signature": "'sym1 'sym2 ==> " }, "harvest": { - "description": "Creates a new quotation quot2 containing all elements of quot1 except for empty quotations.\n \n \n Example\n \n The following program leaves (1 2 3) on the stack:\n \n (1 () () () 2 () 3) \n harvest", + "description": "Creates a new quotation quot2 containing all elements of quot1 except for empty quotations.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 2 3) on the stack:\r\n \r\n (1 () () () 2 () 3) \r\n harvest", "kind": "symbol", "name": "harvest", "signature": "quot1 ==> quot2"

@@ -980,7 +980,7 @@ "name": "inf",

"signature": " ==> num" }, "infix-dequote": { - "description": "Dequotes quot using infix notation. \n \n Note that no special operator preference is defined, symbols precedence is always left-to-right. However, you can use parentheses (quotes) to evaluate expressions before others.\n \n \n Example\n \n The following program leaves 17 on the stack:\n\n (2 + (3 * 5)) infix-dequote\n\n while this program leaves 25 on the stack:\n \n (2 + 3 * 5) infix-dequote", + "description": "Dequotes quot using infix notation. \r\n \r\n Note that no special operator preference is defined, symbols precedence is always left-to-right. However, you can use parentheses (quotes) to evaluate expressions before others.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 17 on the stack:\r\n\r\n (2 + (3 * 5)) infix-dequote\r\n\r\n while this program leaves 25 on the stack:\r\n \r\n (2 + 3 * 5) infix-dequote", "kind": "symbol", "name": "infix-dequote", "signature": "quot ==> a"

@@ -998,7 +998,7 @@ "name": "insert",

"signature": "quot1 a int ==> quot2" }, "integer": { - "description": "Converts a to an integer value based on the following rules:\n \n * If a is true, it is converted to 1.\n * If a is false , it is converted to 0.\n * If a is null, it is converted to 0.\n * If a is an integer, no conversion is performed.\n * If a is a float, it is converted to an integer value by truncating its decimal part.\n * If a is a string, it is parsed as an integer value.", + "description": "Converts a to an integer value based on the following rules:\r\n \r\n * If a is true, it is converted to 1.\r\n * If a is false , it is converted to 0.\r\n * If a is null, it is converted to 0.\r\n * If a is an integer, no conversion is performed.\r\n * If a is a float, it is converted to an integer value by truncating its decimal part.\r\n * If a is a string, it is parsed as an integer value.", "kind": "symbol", "name": "integer", "signature": "a ==> int"

@@ -1010,19 +1010,19 @@ "name": "integer?",

"signature": "a ==> bool" }, "interpolate": { - "description": "Substitutes the placeholders included in str with the values in quot.\n \n Notes\n \n * If quot contains symbols or quotations, they are not interpreted. To do so, call apply before interpolating or use apply-interpolate instead.\n * You can use the $# placeholder to indicate the next placeholder that has not been already referenced in the string.\n * You can use named placeholders like $pwd, but in this case quot must contain a quotation containing both the placeholder names (odd items) and the values (even items).\n \n \n Example\n \n The following code (executed in a directory called '/Users/h3rald/Development/min' containing 19 files):\n \n \"Directory '$1' includes $2 files.\" (. (. ls 'file? filter size)) apply interpolate\n \n produces:\n \n \"Directory '/Users/h3rald/Development/min' includes 19 files.\"", + "description": "Substitutes the placeholders included in str with the values in quot.\r\n \r\n Notes\r\n \r\n * If quot contains symbols or quotations, they are not interpreted. To do so, call apply before interpolating or use apply-interpolate instead.\r\n * You can use the $# placeholder to indicate the next placeholder that has not been already referenced in the string.\r\n * You can use named placeholders like $pwd, but in this case quot must contain a quotation containing both the placeholder names (odd items) and the values (even items).\r\n \r\n \r\n Example\r\n \r\n The following code (executed in a directory called '/Users/h3rald/Development/min' containing 19 files):\r\n \r\n \"Directory '$1' includes $2 files.\" (. (. ls 'file? filter size)) apply interpolate\r\n \r\n produces:\r\n \r\n \"Directory '/Users/h3rald/Development/min' includes 19 files.\"", "kind": "symbol", "name": "interpolate", "signature": "str quot ==> str" }, "intersection": { - "description": "Calculates the intersection quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (1 \"test\") on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) intersection", + "description": "Calculates the intersection quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (1 \"test\") on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) intersection", "kind": "symbol", "name": "intersection", "signature": "quot1 quot2 ==> quot3" }, "invoke": { - "description": "Assming that 'sym is a formatted like *dictionary*/*symbol*, calls *symbol* defined in *dictionary* (note that this also works for nested dictionaries. \n \n \n Example\n \n The following program leaves 100 on the stack:\n \n {{100 :b} :a} :test *test/a/b", + "description": "Assming that 'sym is a formatted like *dictionary*/*symbol*, calls *symbol* defined in *dictionary* (note that this also works for nested dictionaries. \r\n \r\n \r\n Example\r\n \r\n The following program leaves 100 on the stack:\r\n \r\n {{100 :b} :a} :test *test/a/b", "kind": "symbol", "name": "invoke", "signature": "'sym ==> a*"

@@ -1034,13 +1034,13 @@ "name": "join",

"signature": "quot 'sym ==> str" }, "keep": { - "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\n \n Example\n \n The following program leaves 5 3 on the stack:\n \n 2 3 '+ keep", + "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\r\n \r\n Example\r\n \r\n The following program leaves 5 3 on the stack:\r\n \r\n 2 3 '+ keep", "kind": "symbol", "name": "keep", "signature": "a1 quot ==> a* a1" }, "lambda": { - "description": "Defines a new symbol 'sym, containing the specified quotation quot. Unlike with define, in this case quot will not be quoted, so its values will be pushed on the stack when the symbol 'sym is pushed on the stack.\n\nEssentially, this symbol allows you to define an operator without any validation of constraints and bind it to a symbol.", + "description": "Defines a new symbol 'sym, containing the specified quotation quot. Unlike with define, in this case quot will not be quoted, so its values will be pushed on the stack when the symbol 'sym is pushed on the stack.\r\n\r\nEssentially, this symbol allows you to define an operator without any validation of constraints and bind it to a symbol.", "kind": "symbol", "name": "lambda", "signature": "quot 'sym ==> "

@@ -1064,23 +1064,17 @@ "name": "line-info",

"signature": " ==> dict" }, "linrec": { - "description": "Implements linear recursions as follows:\n \n 1. Evaluates quot1.\n * If quot1 evaluates to true, then it evaluates quot2.\n * Otherwises it executes quot3 and recurses using the same four quotations.\n 2. Finally, it executes quot4.\n \n \n Example\n \n The following program leaves 120 on the stack, the factorial of 5:\n \n 5 (dup 0 ==) 'succ (dup pred) '* linrec", + "description": "Implements linear recursions as follows:\r\n \r\n 1. Evaluates quot1.\r\n * If quot1 evaluates to true, then it evaluates quot2.\r\n * Otherwises it executes quot3 and recurses using the same four quotations.\r\n 2. Finally, it executes quot4.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 120 on the stack, the factorial of 5:\r\n \r\n 5 (dup 0 ==) 'succ (dup pred) '* linrec", "kind": "symbol", "name": "linrec", "signature": "quot1 quot2 quot3 quot4 ==> a*" }, "listen": { - "description": "Makes socket dict:socket1 listen to the specified address and port. dict can be empty or contain any of the following properties, used to specify the address and port to listen to respectively.\n \n address\n : The address to listen to (default: **0.0.0.0**).\n port\n : The port to listen to (default: **80**).\n \n \n Example\n \n The following code shows how to create a simple server that listens on port 7777, prints data received from clients, and exits when it receives the string exit:\n \n {} socket {\"127.0.0.1\" :address 7777 :port} listen =srv\n \n \"Server listening on localhost:7777\" puts!\n \n {} socket =cli\n \"\" :line\n (line \"exit\" !=)\n (\n srv cli accept #cli\n cli recv-line @line\n \"Received: $1\" (line) = % puts!\n ) while\n \n \"Exiting...\" puts!\n \n srv close", + "description": "Makes socket dict:socket1 listen to the specified address and port. dict can be empty or contain any of the following properties, used to specify the address and port to listen to respectively.\r\n \r\n address\r\n : The address to listen to (default: **0.0.0.0**).\r\n port\r\n : The port to listen to (default: **80**).\r\n \r\n \r\n Example\r\n \r\n The following code shows how to create a simple server that listens on port 7777, prints data received from clients, and exits when it receives the string exit:\r\n \r\n {} socket {\"127.0.0.1\" :address 7777 :port} listen =srv\r\n \r\n \"Server listening on localhost:7777\" puts!\r\n \r\n {} socket =cli\r\n \"\" :line\r\n (line \"exit\" !=)\r\n (\r\n srv cli accept #cli\r\n cli recv-line @line\r\n \"Received: $1\" (line) = % puts!\r\n ) while\r\n \r\n \"Exiting...\" puts!\r\n \r\n srv close", "kind": "symbol", "name": "listen", "signature": "dict dict:socket1 ==> dict:socket2" }, - "lite?": { - "description": "Returns true if min was built in _lite_ mode.", - "kind": "symbol", - "name": "lite?", - "signature": " ==> bool" - }, "ln": { "description": "Calculates the natural logarithm of num1.", "kind": "symbol",

@@ -1112,7 +1106,7 @@ "name": "log2",

"signature": "num1 ==> num2" }, "loglevel": { - "description": "Sets the current logging level to 'sym. 'sym must be one of the following strings or quoted symbols:\n \n * debug\n * info\n * notice\n * warn\n * error\n * fatal\n \n \n Note\n \n The default logging level is _notice_.", + "description": "Sets the current logging level to 'sym. 'sym must be one of the following strings or quoted symbols:\r\n \r\n * debug\r\n * info\r\n * notice\r\n * warn\r\n * error\r\n * fatal\r\n \r\n \r\n Note\r\n \r\n The default logging level is _notice_.", "kind": "symbol", "name": "loglevel", "signature": "'sym ==> "

@@ -1148,21 +1142,21 @@ "name": "map",

"signature": "quot1 quot2 ==> quot3" }, "map-reduce": { - "description": "Applies quot2 (map) to each element of quot1 and then applies quot3 (reduce) to each successive element of quot1. quot1 must have at least one element.\n \n \n Example\n \n The following program leaves 35 on the stack:\n \n (1 3 5) \n (dup *) (+) map-reduce", + "description": "Applies quot2 (map) to each element of quot1 and then applies quot3 (reduce) to each successive element of quot1. quot1 must have at least one element.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 35 on the stack:\r\n \r\n (1 3 5) \r\n (dup *) (+) map-reduce", "kind": "symbol", "name": "map-reduce", "signature": "quot1 quot2 quot3 ==> int" }, "mapkey": { - "description": "Maps the named key/key combination 'sym to the quotation quot, so that quot is executed when key 'sym is pressed. \n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * The quotation will be executed by a copy of the min interpreter created when the mapping was defined. In other words, quotations executed by key bindings will not affect the current stack.\n \n \n Example\n \n The following program:\n \n (clear) 'ctrl+l keymap\n \n causes the CTRL+L key to clear the screen.", + "description": "Maps the named key/key combination 'sym to the quotation quot, so that quot is executed when key 'sym is pressed. \r\n\r\n \r\n Notes\r\n\r\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\r\n * The quotation will be executed by a copy of the min interpreter created when the mapping was defined. In other words, quotations executed by key bindings will not affect the current stack.\r\n \r\n \r\n Example\r\n \r\n The following program:\r\n \r\n (clear) 'ctrl+l keymap\r\n \r\n causes the CTRL+L key to clear the screen.", "kind": "symbol", "name": "mapkey", "signature": "quot 'sym ==> " }, - "match": { - "description": "Returns true if str2 matches str1, false otherwise.\n \n Tip\n \n str2 can be a sgregex-compatible regular expression.", + "match?": { + "description": "Returns true if str2 matches str1, false otherwise.\r\n \r\n Tip\r\n \r\n str2 is a Perl-compatible regular expression", "kind": "symbol", - "name": "match", + "name": "match?", "signature": "str1 str2 ==> bool" }, "md4": {

@@ -1268,7 +1262,7 @@ "name": "one?",

"signature": "quot1 quot2 ==> bool" }, "operator": { - "description": "Provides a way to define a new operator (symbol, sigil, or typeclass) on the current scope performing additional checks (compared to define and define-sigil), and automatically mapping inputs and outputs.\n \n quot is a quotation containing:\n \n * A symbol identifying the type of operator to define (symbol, sigil, or typeclass).\n * A symbol identifying the name of the operator.\n * A quotation defining the signature of the operatorm containing input and output values identified by their type and a capturing symbol, separated by the == symbol.\n * A quotation identifying the body of the operator.\n\n The main additional features offered by this way of defining operators are the following:\n\n * Both input and output values are checked against a type (like when using the expect operator *and* automatically captured in a symbol that can be referenced in the operator body quotation.\n * The full signature of the operator is declared, making the resulting code easier to understand at quick glance.\n * 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).\n * It is possible to use the return symbol within the body quotation to immediately stop the evaluation of the body quotation and automatically push the output values on the stack.\n \n \n Example\n \n The following program defines a pow operator that calculates the power of a number providing its base and exponent, and handling some NaN results using the return symbol:\n\n (\n symbol pow\n (num :base int :exp == num :result)\n ( \n (base 0 == exp 0 == and)\n (nan @result return)\n when\n (base 1 == exp inf == and)\n (nan @result return)\n when\n (base inf == exp 0 == and)\n (nan @result return)\n when\n exp 1 - :n\n base (dup) n times (*) n times @result\n )\n ) ::", + "description": "Provides a way to define a new operator (symbol, sigil, or typeclass) on the current scope performing additional checks (compared to define and define-sigil), and automatically mapping inputs and outputs.\r\n \r\n quot is a quotation containing:\r\n \r\n * A symbol identifying the type of operator to define (symbol, sigil, or typeclass).\r\n * A symbol identifying the name of the operator.\r\n * A quotation defining the signature of the operatorm containing input and output values identified by their type and a capturing symbol, separated by the == symbol.\r\n * A quotation identifying the body of the operator.\r\n\r\n The main additional features offered by this way of defining operators are the following:\r\n\r\n * Both input and output values are checked against a type (like when using the expect operator *and* automatically captured in a symbol that can be referenced in the operator body quotation.\r\n * The full signature of the operator is declared, making the resulting code easier to understand at quick glance.\r\n * 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).\r\n * It is possible to use the return symbol within the body quotation to immediately stop the evaluation of the body quotation and automatically push the output values on the stack.\r\n \r\n \r\n Example\r\n \r\n The following program defines a pow operator that calculates the power of a number providing its base and exponent, and handling some NaN results using the return symbol:\r\n\r\n (\r\n symbol pow\r\n (num :base int :exp == num :result)\r\n ( \r\n (base 0 == exp 0 == and)\r\n (nan @result return)\r\n when\r\n (base 1 == exp inf == and)\r\n (nan @result return)\r\n when\r\n (base inf == exp 0 == and)\r\n (nan @result return)\r\n when\r\n exp 1 - :n\r\n base (dup) n times (*) n times @result\r\n )\r\n ) ::", "kind": "symbol", "name": "operator", "signature": "quot ==> a*"

@@ -1322,7 +1316,7 @@ "name": "parse-url",

"signature": "str ==> dict:url" }, "partition": { - "description": "Partitions quot1 into two quotations: quot3 contains all elements of quot1 that satisfy predicate quot2, quot4 all the others.\n \n \n Example\n \n The following program leaves (1 3 5) (2 4 6) on the stack:\n \n (1 2 3 4 5 6) \n (odd?) partition", + "description": "Partitions quot1 into two quotations: quot3 contains all elements of quot1 that satisfy predicate quot2, quot4 all the others.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 3 5) (2 4 6) on the stack:\r\n \r\n (1 2 3 4 5 6) \r\n (odd?) partition", "kind": "symbol", "name": "partition", "signature": "quot1 quot2 ==> quot3 quot4"

@@ -1370,7 +1364,7 @@ "name": "prefix",

"signature": "'sym1 'sym2 ==> str" }, "prefix-dequote": { - "description": "Dequotes quot using prefix notation (essentially it reverses quot and dequotes it).\n \n \n Example\n \n The following program leaves 4 on the stack:\n\n (* 8 4) prefix-dequote", + "description": "Dequotes quot using prefix notation (essentially it reverses quot and dequotes it).\r\n \r\n \r\n Example\r\n \r\n The following program leaves 4 on the stack:\r\n\r\n (* 8 4) prefix-dequote", "kind": "symbol", "name": "prefix-dequote", "signature": "quot ==> a"

@@ -1394,13 +1388,13 @@ "name": "product",

"signature": "quot ==> int" }, "prompt": { - "description": "This symbol is used to configure the prompt of the min shell. By default, it is set to the following quotation:\n \n (\"[$1]$$ \" (.) = %)\n \n Unlike other predefined symbols, this symbol is _unsealed_, which means it can be modified.", + "description": "This symbol is used to configure the prompt of the min shell. By default, it is set to the following quotation:\r\n \r\n (\"[$1]$$ \" (.) = %)\r\n \r\n Unlike other predefined symbols, this symbol is _unsealed_, which means it can be modified.", "kind": "symbol", "name": "prompt", "signature": " ==> str" }, "publish": { - "description": "Publishes symbol 'sym to the scope of dict.\n \n \n Example\n \n Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope:\n 'my-local-symbol ROOT publish", + "description": "Publishes symbol 'sym to the scope of dict.\r\n \r\n \r\n Example\r\n \r\n Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope:\r\n 'my-local-symbol ROOT publish", "kind": "symbol", "name": "publish", "signature": "'sym dict ==> "

@@ -1466,7 +1460,7 @@ "name": "raise",

"signature": "dict:error ==> " }, "random": { - "description": "Returns a random number int2 between 0 and int1-1. \n \n \n Note\n \n You must call randomize to initialize the random number generator, otherwise the same sequence of numbers will be returned.", + "description": "Returns a random number int2 between 0 and int1-1. \r\n \r\n \r\n Note\r\n \r\n You must call randomize to initialize the random number generator, otherwise the same sequence of numbers will be returned.", "kind": "symbol", "name": "random", "signature": "int1 ==> int2"

@@ -1496,23 +1490,17 @@ "name": "recv",

"signature": "dict:socket int ==> str" }, "recv-line": { - "description": "Waits to receive a line of data from dict:socket and returns the resulting data str. \"\" is returned if dict:socket is disconnected.\n \n \n Example\n \n The following code shows how to make a simple GET request to <http://httpbin.org/uuid to receive a random UUID and display its response:\n \n \n {} socket \"httpbin.org\" 80 connect =cli\n \n cli \"GET /uuid HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n\" send\n \n cli recv-line puts :line\n (line \"\\}\" match not) \n (\n cli recv-line puts @line\n ) while", + "description": "Waits to receive a line of data from dict:socket and returns the resulting data str. \"\" is returned if dict:socket is disconnected.\r\n \r\n \r\n Example\r\n \r\n The following code shows how to make a simple GET request to <http://httpbin.org/uuid to receive a random UUID and display its response:\r\n \r\n \r\n {} socket \"httpbin.org\" 80 connect =cli\r\n \r\n cli \"GET /uuid HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n\" send\r\n \r\n cli recv-line puts :line\r\n (line \"\\}\" match not) \r\n (\r\n cli recv-line puts @line\r\n ) while", "kind": "symbol", "name": "recv-line", "signature": "dict:socket ==> str" }, "reduce": { - "description": "Combines each successive element of quot1 using quot2. On the first iteration, the first two inputs processed by quot2 are a and the first element of quot1.\n \n \n Example\n \n The following program leaves 120 on the stack:\n \n (1 2 3 4 5) \n 1 (*) reduce", + "description": "Combines each successive element of quot1 using quot2. On the first iteration, the first two inputs processed by quot2 are a and the first element of quot1.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 120 on the stack:\r\n \r\n (1 2 3 4 5) \r\n 1 (*) reduce", "kind": "symbol", "name": "reduce", "signature": "quot1 a quot2 ==> int" }, - "regex": { - "description": "Performs a search and/or a search-and-replace operation using pattern str2.\n \n str2 can be one of the following patterns:\n \n * **/**_search-regex_**/**_modifiers_\n * **s/**_search-regex_**/**_replacemenet_**/**_modifiers_\n \n quot is always a quotation containing:\n \n * One or more strings containing the first match and captures (if any), like for the search operator.\n * A string containing the resuling string after the search-and-replace operation.\n \n \n Tip\n \n * _search-regex_ can be a sgregex-compatible regular expression.\n * _modifiers_ are optionals can contain one or more of the following characters, in any order:\n * **i**: case-insensitive match.\n * **m**: multi-line match.\n * **s**: dot character includes newlines.\n \n \n Example: Search\n \n The following:\n \n \"This is a GOOD idea.\" \"/(good) idea/i\" regex\n \n produces: (\"GOOD idea\", \"GOOD\")\n \n \n Example: Search and Replace\n \n The following:\n \n \"This is a GOOD idea.\" \"s/good/bad/i\" regex\n \n produces: (\"This is a bad idea\")", - "kind": "symbol", - "name": "regex", - "signature": "str1 str2 ==> quot" - }, "reject": { "description": "Returns a new quotatios quot3 including all elements of quot1 that do not satisfy predicate quot2 (i.e. the opposite of filter)", "kind": "symbol",

@@ -1538,19 +1526,19 @@ "name": "repeat",

"signature": "'sym int ==> str" }, "replace": { - "description": "Returns a copy of str1 containing all occurrences of str2 replaced by str3\n \n Tip\n \n str2 can be a sgregex-compatible regular expression.\n \n \n Example\n \n The following:\n \n \"This is a stupid test. Is it really a stupid test?\" \" s[a-z]+\" \" simple\" replace\n \n produces:\n \n \"This is a simple test. Is it really a simple test?\"", + "description": "Returns a copy of str1 containing all occurrences of str2 replaced by str3\r\n \r\n Tip\r\n \r\n str2 is a Perl-compatible regular expression.\r\n \r\n \r\n Example\r\n \r\n The following:\r\n \r\n \"This is a stupid test. Is it really a stupid test?\" \" s[a-z]+\" \" simple\" replace\r\n \r\n produces:\r\n \r\n \"This is a simple test. Is it really a simple test?\"", "kind": "symbol", "name": "replace", "signature": "str1 str2 str3 ==> str4" }, "replace-apply": { - "description": "Returns a copy of str1 containing all occurrences of str2 replaced by applying quot to each quotation correponding to each match.\n \n Tip\n \n str2 can be a sgregex-compatible regular expression.\n \n \n Example\n \n The following:\n \n \":1::2::3::4:\" \":(\\d):\" (=m m 1 get :d \"-$#-\" (d) =%) replace-apply\n \n produces:\n \n \"-1--2--3--4-\"\n \n Note that for each match the following quotations (each containing tbe full matcb and the captured matches) are produced as input for the replace quotation:\n (\"-1-\" \"1\")\n (\"-2-\" \"2\")\n (\"-3-\" \"3\")\n (\"-4-\" \"4\")", + "description": "Returns a copy of str1 containing all occurrences of str2 replaced by applying quot to each quotation correponding to each match.\r\n \r\n Tip\r\n \r\n str2 is a Perl-compatible regular expression.\r\n \r\n \r\n Example\r\n \r\n The following:\r\n \r\n \":1::2::3::4:\" \":(\\d):\" (=m m 1 get :d \"-$#-\" (d) =%) replace-apply\r\n \r\n produces:\r\n \r\n \"-1--2--3--4-\"\r\n \r\n Note that for each match the following quotations (each containing tbe full matcb and the captured matches) are produced as input for the replace quotation:\r\n (\"-1-\" \"1\")\r\n (\"-2-\" \"2\")\r\n (\"-3-\" \"3\")\r\n (\"-4-\" \"4\")", "kind": "symbol", "name": "replace-apply", "signature": "str1 str2 quot ==> str3" }, "request": { - "description": "Performs an HTTP request. Note that dict is can be a standard (untyped) dictionary but its fields will be validated like if it was a dict:http-request.\n\n \n Example\n \n The following code constructs dict and passes it to the **request** operator to perform an HTTP GET request to <http://httpbin.org/ip:\n \n {}\n \"GET\" url\n request", + "description": "Performs an HTTP request. Note that dict is can be a standard (untyped) dictionary but its fields will be validated like if it was a dict:http-request.\r\n\r\n \r\n Example\r\n \r\n The following code constructs dict and passes it to the **request** operator to perform an HTTP GET request to <http://httpbin.org/ip:\r\n \r\n {}\r\n \"GET\" url\r\n request", "kind": "symbol", "name": "request", "signature": "dict ==> dict:http-response"

@@ -1568,7 +1556,7 @@ "name": "rest",

"signature": "quot1 ==> quot2" }, "return": { - "description": "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. \n\nIf used outside of the body quotation of an operator definition, it raises an exception.", + "description": "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. \r\n\r\nIf used outside of the body quotation of an operator definition, it raises an exception.", "kind": "symbol", "name": "return", "signature": " ==> "

@@ -1628,7 +1616,7 @@ "name": "saved-symbols",

"signature": " ==> (str*)" }, "scope": { - "description": "Returns a dictionary dict holding a reference to the current scope.\n \n This can be useful to save a reference to a given execution scope to access later on.\n\n \n Example\n \n The following program leaves {(2) :two ;module} on the stack:\n \n {} :myscope (2 :two scope @myscope) -", + "description": "Returns a dictionary dict holding a reference to the current scope.\r\n \r\n This can be useful to save a reference to a given execution scope to access later on.\r\n\r\n \r\n Example\r\n \r\n The following program leaves {(2) :two ;module} on the stack:\r\n \r\n {} :myscope (2 :two scope @myscope) -", "kind": "symbol", "name": "scope", "signature": " ==> dict"

@@ -1670,7 +1658,7 @@ "name": "sealed-symbol?",

"signature": "'sym ==> bool" }, "search": { - "description": "Returns a quotation containing the first occurrence of str2 within str1. Note that:\n \n * The first element of quot is the matching substring.\n * Other elements (if any) contain captured substrings.\n \n \n Tip\n \n str2 can be a sgregex-compatible regular expression.\n \n \n Example\n \n The following:\n \n \"192.168.1.1, 127.0.0.1\" \"[0-9]+\\.[0-9]+\\.([0-9]+)\\.([0-9]+)\" search\n \n produces: (\"192.168.1.1\", \"1\", \"1\")", + "description": "Returns a quotation containing the first occurrence of str2 within str1. Note that:\r\n \r\n * The first element of quot is the matching substring.\r\n * Other elements (if any) contain captured substrings.\r\n * If no matches are found, the quotation contains empty strings.\r\n \r\n \r\n Tip\r\n \r\n str2 is a Perl-compatible regular expression.\r\n \r\n \r\n Example\r\n \r\n The following:\r\n \r\n \"192.168.1.1, 127.0.0.1\" \"[0-9]+\\.[0-9]+\\.([0-9]+)\\.([0-9]+)\" search\r\n \r\n produces: (\"192.168.1.1\", \"1\", \"1\")", "kind": "symbol", "name": "search", "signature": "str1 str2 ==> quot"

@@ -1808,19 +1796,19 @@ "name": "sleep",

"signature": "int ==> " }, "slice": { - "description": "Creates a new quotation quot2 obtaining by selecting all elements of quot1 between indexes int1 and int2.\n \n \n Example\n \n The following program leaves (3 4 5) on the stack:\n \n (1 2 3 4 5 6) \n 2 4 slice", + "description": "Creates a new quotation quot2 obtaining by selecting all elements of quot1 between indexes int1 and int2.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (3 4 5) on the stack:\r\n \r\n (1 2 3 4 5 6) \r\n 2 4 slice", "kind": "symbol", "name": "slice", "signature": "quot1 int1 int2 ==> quot2" }, "socket": { - "description": "Opens a new socket.\n \n dict can be empty or contain any of the following properties, used to specify the domain, type and protocol of the socket respectively.\n \n domain\n : The socket domain. It can be set to one of the following values:\n \n * **ipv4** (default): Internet Protocol version 4.\n * **ipv6**: Internet Protocol version 6.\n * **unix**: local Unix file (not supported on Windows systems).\n type\n : The socket type. It can be set to one of the following values:\n \n * **stream** (default): Reliable stream-oriented service or Stream Socket.\n * **dgram**: Datagram service or Datagram Socket.\n * **raw**: Raw protocols atop the network layer.\n * **seqpacket**: Reliable sequenced packet service.\n protocol\n : The socket protocol. It can be set to one of the following values:\n \n * **tcp** (default): Transmission Control Protocol.\n * **udp**: User Datagram Protocol.\n * **ipv4**: Internet Protocol version 4 (not supported on Windows systems).\n * **ipv6**: Internet Protocol version 6 (not supported on Windows systems).\n * **raw**: Raw IP Packets protocol (not supported on Windows systems).\n * **icmp**: Internet Control Message Protocol (not supported on Windows systems).", + "description": "Opens a new socket.\r\n \r\n dict can be empty or contain any of the following properties, used to specify the domain, type and protocol of the socket respectively.\r\n \r\n domain\r\n : The socket domain. It can be set to one of the following values:\r\n \r\n * **ipv4** (default): Internet Protocol version 4.\r\n * **ipv6**: Internet Protocol version 6.\r\n * **unix**: local Unix file (not supported on Windows systems).\r\n type\r\n : The socket type. It can be set to one of the following values:\r\n \r\n * **stream** (default): Reliable stream-oriented service or Stream Socket.\r\n * **dgram**: Datagram service or Datagram Socket.\r\n * **raw**: Raw protocols atop the network layer.\r\n * **seqpacket**: Reliable sequenced packet service.\r\n protocol\r\n : The socket protocol. It can be set to one of the following values:\r\n \r\n * **tcp** (default): Transmission Control Protocol.\r\n * **udp**: User Datagram Protocol.\r\n * **ipv4**: Internet Protocol version 4 (not supported on Windows systems).\r\n * **ipv6**: Internet Protocol version 6 (not supported on Windows systems).\r\n * **raw**: Raw IP Packets protocol (not supported on Windows systems).\r\n * **icmp**: Internet Control Message Protocol (not supported on Windows systems).", "kind": "symbol", "name": "socket", "signature": "dict ==> dict:socket" }, "sort": { - "description": "Sorts all elements of quot1 according to predicate quot2. \n \n \n Example\n \n The following program leaves (1 3 5 7 9 13 16) on the stack:\n \n (1 9 5 13 16 3 7) ' sort", + "description": "Sorts all elements of quot1 according to predicate quot2. \r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 3 5 7 9 13 16) on the stack:\r\n \r\n (1 9 5 13 16 3 7) ' sort", "kind": "symbol", "name": "sort", "signature": "quot1 quot2 ==> quot3"

@@ -1832,13 +1820,13 @@ "name": "source",

"signature": "'sym ==> quot" }, "split": { - "description": "Splits 'sym1 using separator 'sym2 and returns the resulting strings within the quotation quot.", + "description": "Splits 'sym1 using separator 'sym2 (a Perl-compatible regular expression) and returns the resulting strings within the quotation quot.", "kind": "symbol", "name": "split", "signature": "'sym1 'sym2 ==> quot" }, "spread": { - "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\n \n Example\n \n The following program leaves (1 4) on the stack:\n \n (1 2) (3 4) ((0 get) (1 get)) spread", + "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\r\n \r\n Example\r\n \r\n The following program leaves (1 4) on the stack:\r\n \r\n (1 2) (3 4) ((0 get) (1 get)) spread", "kind": "symbol", "name": "spread", "signature": "a* (quot*) ==> a*"

@@ -1850,7 +1838,7 @@ "name": "sqrt",

"signature": "num1 ==> num2" }, "start-server": { - "description": "Starts an HTTP server based on the configuration provided in dict.\n \n dict is a dictionary containing the following keys:\n \n address\n : The address to bind the server to (default: **127.0.0.1**).\n port\n : The port to bind the server to.\n handler\n : A quotation with the following signature, used to handle all incoming requests: [dict:http-request &rArr; dict:http-response](class:kwd)\n \n \n Example\n \n The following program starts a very simple HTTP server that can display the current timestamp or date and time in ISO 8601 format:\n \n ; Define the request handler\n (\n ; Assume there is a request on the stack, take it off and give it the name req\n :req\n ; Let's see what we got (print req to standard out)\n \"THE REQUEST:\" puts! req puts!\n ; The request is a dictionary, we retrieve the value for the key url, and give it the name url\n req /url :url\n \"THE URL is '$1'.\" url quote ))\n ) case\n :body\n ; Prepare the response\n {} body handler\n 5555 %port\n \n ; Start server\n \"Server started on port 5555.\" puts!\n \"Press Ctrl+C to stop.\" puts!\n start-server", + "description": "Starts an HTTP server based on the configuration provided in dict.\r\n \r\n dict is a dictionary containing the following keys:\r\n \r\n address\r\n : The address to bind the server to (default: **127.0.0.1**).\r\n port\r\n : The port to bind the server to.\r\n handler\r\n : A quotation with the following signature, used to handle all incoming requests: [dict:http-request &rArr; dict:http-response](class:kwd)\r\n \r\n \r\n Example\r\n \r\n The following program starts a very simple HTTP server that can display the current timestamp or date and time in ISO 8601 format:\r\n \r\n ; Define the request handler\r\n (\r\n ; Assume there is a request on the stack, take it off and give it the name req\r\n :req\r\n ; Let's see what we got (print req to standard out)\r\n \"THE REQUEST:\" puts! req puts!\r\n ; The request is a dictionary, we retrieve the value for the key url, and give it the name url\r\n req /url :url\r\n \"THE URL is '$1'.\" url quote ))\r\n ) case\r\n :body\r\n ; Prepare the response\r\n {} body handler\r\n 5555 %port\r\n \r\n ; Start server\r\n \"Server started on port 5555.\" puts!\r\n \"Press Ctrl+C to stop.\" puts!\r\n start-server", "kind": "symbol", "name": "start-server", "signature": "dict ==> "

@@ -1940,7 +1928,7 @@ "name": "symlink?",

"signature": "'sym ==> bool" }, "symmetric-difference": { - "description": "Calculates the symmetric difference quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (true \"a\" 2) on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) symmetric-difference", + "description": "Calculates the symmetric difference quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (true \"a\" 2) on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) symmetric-difference", "kind": "symbol", "name": "symmetric-difference", "signature": "quot1 quot2 ==> quot3"

@@ -1970,7 +1958,7 @@ "name": "tanh",

"signature": "num1 ==> num2" }, "tap": { - "description": "Performs the following operations:\n \n 1. Removes a from the stack.\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\n 1. Pushes a back to the stack.\n 2. Dequotes the quotation and saves the result as a.\n 3. Push the resulting a back on the stack.\n \n \n Example\n \n The following program:\n \n {1 :a 2 :b 3 :c} (\n (dup /a succ succ b)\n ) tap\n \n Returns {3 :a 3 :b 3 :c}.", + "description": "Performs the following operations:\r\n \r\n 1. Removes a from the stack.\r\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\r\n 1. Pushes a back to the stack.\r\n 2. Dequotes the quotation and saves the result as a.\r\n 3. Push the resulting a back on the stack.\r\n \r\n \r\n Example\r\n \r\n The following program:\r\n \r\n {1 :a 2 :b 3 :c} (\r\n (dup /a succ succ b)\r\n ) tap\r\n \r\n Returns {3 :a 3 :b 3 :c}.", "kind": "symbol", "name": "tap", "signature": "a quot ==> a"

@@ -1982,7 +1970,7 @@ "name": "tau",

"signature": " ==> num" }, "tformat": { - "description": "Formats timestamp int using string str.\n \n \n Tip\n \n For information on special characters in the format string, see the [format](https://nim-lang.org/docs/times.html#format,TimeInfo,string) nim method.", + "description": "Formats timestamp int using string str.\r\n \r\n \r\n Tip\r\n \r\n For information on special characters in the format string, see the [format](https://nim-lang.org/docs/times.html#format,TimeInfo,string) nim method.", "kind": "symbol", "name": "tformat", "signature": "int str ==> str"

@@ -2030,7 +2018,7 @@ "name": "to-timestamp",

"signature": "dict:timeinfo ==> int" }, "to-yaml": { - "description": "Converts a into a YAML string.\n\n \n Note\n \n At present, only min dictionaries containing string values are supported.", + "description": "Converts a into a YAML string.\r\n\r\n \r\n Note\r\n \r\n At present, only min dictionaries containing string values are supported.", "kind": "symbol", "name": "to-yaml", "signature": "a ==> str"

@@ -2042,7 +2030,7 @@ "name": "trunc",

"signature": "num1 ==> num2" }, "try": { - "description": "Evaluates a quotation as a try/catch/finally block. \n \n The must contain the following elements:\n \n 1. A quotation quot1 containing the code to be evaluated (_try_ block).\n 1. _(optional)_ A quotation quot2 containing the code to execute in case of error (_catch_ block).\n 1. _(optional)_ A quotation quot3 containing the code to execute after the code has been evaluated, whether an error occurred or not (_finally_ block).\n \n \n Example\n \n The following program executed on an empty stack prints the message \"Insufficient items on the stack\" and pushes 0 on the stack:\n \n (\n (pop)\n (format-error puts)\n (0)\n ) try", + "description": "Evaluates a quotation as a try/catch/finally block. \r\n \r\n The must contain the following elements:\r\n \r\n 1. A quotation quot1 containing the code to be evaluated (_try_ block).\r\n 1. _(optional)_ A quotation quot2 containing the code to execute in case of error (_catch_ block).\r\n 1. _(optional)_ A quotation quot3 containing the code to execute after the code has been evaluated, whether an error occurred or not (_finally_ block).\r\n \r\n \r\n Example\r\n \r\n The following program executed on an empty stack prints the message \"Insufficient items on the stack\" and pushes 0 on the stack:\r\n \r\n (\r\n (pop)\r\n (format-error puts)\r\n (0)\r\n ) try", "kind": "symbol", "name": "try", "signature": "(quot1 quot2? quot3?) ==> a*"

@@ -2066,7 +2054,7 @@ "name": "typealias",

"signature": "'sym1 'sym2 ==> " }, "union": { - "description": "Calculates the union quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (true 1 \"test\" \"a\" 2) on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) union", + "description": "Calculates the union quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (true 1 \"test\" \"a\" 2) on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) union", "kind": "symbol", "name": "union", "signature": "quot1 quot2 ==> quot3"

@@ -2078,7 +2066,7 @@ "name": "unless",

"signature": "quot1 quot2 ==> a*" }, "unmapkey": { - "description": "Unmaps a previously-mapped key or key-combination 'sym, restoring the default mapping if available.\n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * At present, all the default mappings of min are those provided by the [nimline](https://h3rald.com/nimline/nimline.html) library.", + "description": "Unmaps a previously-mapped key or key-combination 'sym, restoring the default mapping if available.\r\n\r\n \r\n Notes\r\n\r\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\r\n * At present, all the default mappings of min are those provided by the [nimline](https://h3rald.com/nimline/nimline.html) library.", "kind": "symbol", "name": "unmapkey", "signature": "'sym ==> "

@@ -2132,13 +2120,13 @@ "name": "which",

"signature": "'sym ==> str" }, "while": { - "description": "Executes quot2 while quot1 evaluates to true.\n \n \n Example\n \n The following program prints all natural numbers from 0 to 10:\n \n 0 :count \n (count 10 <=) \n (count puts succ @count) while", + "description": "Executes quot2 while quot1 evaluates to true.\r\n \r\n \r\n Example\r\n \r\n The following program prints all natural numbers from 0 to 10:\r\n \r\n 0 :count \r\n (count 10 <=) \r\n (count puts succ @count) while", "kind": "symbol", "name": "while", "signature": "quot1 quot2 ==> a*" }, "with": { - "description": "Pushes each item of quot1 on the stack using the scope of quot2 as scope. \n\n \n Example\n \n This operator is useful to define symbols on the [ROOT](class:kwd) scope or another scope. For example min's prelude includes the following code used to import certain modules only if min was not compiled in lite mode:\n \n 'lite? (\n (\n 'crypto import\n 'math import\n 'net import\n 'http import\n ) ROOT with\n ) unless", + "description": "Pushes each item of quot1 on the stack using the scope of quot2 as scope.", "kind": "symbol", "name": "with", "signature": "quot1 quot2 ==> a*"
M min.nimmin.nim

@@ -49,92 +49,90 @@ var MINMODULES* = newSeq[string](0)

var customPrelude {.threadvar.} : string customPrelude = "" -when not defined(mini): - if logging.getHandlers().len == 0: - newNiftyLogger().addHandler() +if logging.getHandlers().len == 0: + newNiftyLogger().addHandler() - proc getExecs(): seq[string] = - var res = newSeq[string](0) - let getFiles = proc(dir: string) = - for c, s in walkDir(dir, true): - if (c == pcFile or c == pcLinkToFile) and not res.contains(s): - res.add s - getFiles(getCurrentDir()) - for dir in "PATH".getEnv.split(PathSep): - getFiles(dir) - res.sort(system.cmp) - return res +proc getExecs(): seq[string] = + var res = newSeq[string](0) + let getFiles = proc(dir: string) = + for c, s in walkDir(dir, true): + if (c == pcFile or c == pcLinkToFile) and not res.contains(s): + res.add s + getFiles(getCurrentDir()) + for dir in "PATH".getEnv.split(PathSep): + getFiles(dir) + res.sort(system.cmp) + return res - proc getCompletions*(ed: LineEditor, symbols: seq[string]): seq[string] = - var words = ed.lineText.split(" ") - var word: string - if words.len == 0: - word = ed.lineText +proc getCompletions*(ed: LineEditor, symbols: seq[string]): seq[string] = + var words = ed.lineText.split(" ") + var word: string + if words.len == 0: + word = ed.lineText + else: + word = words[words.len-1] + if word.startsWith("'"): + return symbols.mapIt("'" & $it) + if word.startsWith("~"): + return symbols.mapIt("~" & $it) + if word.startsWith("?"): + return symbols.mapIt("?" & $it) + if word.startsWith("@"): + return symbols.mapIt("@" & $it) + if word.startsWith("#"): + return symbols.mapIt("#" & $it) + if word.startsWith(">"): + return symbols.mapIt(">" & $it) + if word.startsWith("*"): + return symbols.mapIt("*" & $it) + if word.startsWith("("): + return symbols.mapIt("(" & $it) + if word.startsWith("<"): + return toSeq(MINSYMBOLS.readFile.parseJson.pairs).mapIt("<" & $it[0]) + if word.startsWith("$"): + return toSeq(envPairs()).mapIt("$" & $it[0]) + if word.startsWith("!"): + return getExecs().mapIt("!" & $it) + if word.startsWith("!!"): + return getExecs().mapIt("!!" & $it) + if word.startsWith("!\""): + return getExecs().mapIt("!\"" & $it) + if word.startsWith("!!\""): + return getExecs().mapIt("!!\"" & $it) + if word.startsWith("&\""): + return getExecs().mapIt("&\"" & $it) + if word.startsWith("&"): + return getExecs().mapIt("&" & $it) + if word.startsWith("\""): + var f = word[1..^1] + if f == "": + f = getCurrentDir().replace("\\", "/") + return toSeq(walkDir(f, true)).mapIt("\"$1" % it.path.replace("\\", "/")) + elif f.dirExists: + f = f.replace("\\", "/") + if f[f.len-1] != '/': + f = f & "/" + return toSeq(walkDir(f, true)).mapIt("\"$1$2" % [f, it.path.replace("\\", "/")]) else: - word = words[words.len-1] - if word.startsWith("'"): - return symbols.mapIt("'" & $it) - if word.startsWith("~"): - return symbols.mapIt("~" & $it) - if word.startsWith("?"): - return symbols.mapIt("?" & $it) - if word.startsWith("@"): - return symbols.mapIt("@" & $it) - if word.startsWith("#"): - return symbols.mapIt("#" & $it) - if word.startsWith(">"): - return symbols.mapIt(">" & $it) - if word.startsWith("*"): - return symbols.mapIt("*" & $it) - if word.startsWith("("): - return symbols.mapIt("(" & $it) - if word.startsWith("<"): - return toSeq(MINSYMBOLS.readFile.parseJson.pairs).mapIt("<" & $it[0]) - if word.startsWith("$"): - return toSeq(envPairs()).mapIt("$" & $it[0]) - if word.startsWith("!"): - return getExecs().mapIt("!" & $it) - if word.startsWith("!!"): - return getExecs().mapIt("!!" & $it) - if word.startsWith("!\""): - return getExecs().mapIt("!\"" & $it) - if word.startsWith("!!\""): - return getExecs().mapIt("!!\"" & $it) - if word.startsWith("&\""): - return getExecs().mapIt("&\"" & $it) - if word.startsWith("&"): - return getExecs().mapIt("&" & $it) - if word.startsWith("\""): - var f = word[1..^1] - if f == "": - f = getCurrentDir().replace("\\", "/") - return toSeq(walkDir(f, true)).mapIt("\"$1" % it.path.replace("\\", "/")) - elif f.dirExists: - f = f.replace("\\", "/") - if f[f.len-1] != '/': - f = f & "/" - return toSeq(walkDir(f, true)).mapIt("\"$1$2" % [f, it.path.replace("\\", "/")]) + var dir: string + if f.contains("/") or dir.contains("\\"): + dir = f.parentDir + let file = f.extractFileName + return toSeq(walkDir(dir, true)).filterIt(it.path.toLowerAscii.startsWith(file.toLowerAscii)).mapIt("\"$1/$2" % [dir, it.path.replace("\\", "/")]) else: - var dir: string - if f.contains("/") or dir.contains("\\"): - dir = f.parentDir - let file = f.extractFileName - return toSeq(walkDir(dir, true)).filterIt(it.path.toLowerAscii.startsWith(file.toLowerAscii)).mapIt("\"$1/$2" % [dir, it.path.replace("\\", "/")]) - else: - dir = getCurrentDir() - return toSeq(walkDir(dir, true)).filterIt(it.path.toLowerAscii.startsWith(f.toLowerAscii)).mapIt("\"$1" % [it.path.replace("\\", "/")]) - return symbols + dir = getCurrentDir() + return toSeq(walkDir(dir, true)).filterIt(it.path.toLowerAscii.startsWith(f.toLowerAscii)).mapIt("\"$1" % [it.path.replace("\\", "/")]) + return symbols proc stdLib*(i: In) = - when not defined(mini): - setLogFilter(logging.lvlNotice) - if not MINSYMBOLS.fileExists: - MINSYMBOLS.writeFile("{}") - if not MINHISTORY.fileExists: - MINHISTORY.writeFile("") - if not MINRC.fileExists: - MINRC.writeFile("") + setLogFilter(logging.lvlNotice) + if not MINSYMBOLS.fileExists: + MINSYMBOLS.writeFile("{}") + if not MINHISTORY.fileExists: + MINHISTORY.writeFile("") + if not MINRC.fileExists: + MINRC.writeFile("") i.lang_module i.stack_module i.seq_module

@@ -196,29 +194,20 @@ MINCOMPILED = true

let dotindex = i.filename.rfind(".") let nimFile = i.filename[0..dotindex-1] & ".nim" if main: - when defined(mini): - minilogger.notice("Generating $#..." % nimFile) - else: - logging.notice("Generating $#..." % nimFile) + logging.notice("Generating $#..." % nimFile) result = i.initCompiledFile(MINMODULES) for m in MINMODULES: let f = m.replace("\\", "/") result.add "### $#" % f - when defined(mini): - minilogger.notice("- Including: $#" % f) - else: - logging.notice("- Including: $#" % f) + logging.notice("- Including: $#" % f) result = result.concat(minFile(f, "compile", main = false)) result.add "### $# (main)" % i.filename result = result.concat(i.compileFile(main)) writeFile(nimFile, result.join("\n")) - when not defined(mini): - let cmd = "nim c $#$#" % [NIMOPTIONS&" ", nimFile] - logging.notice("Calling Nim compiler:") - logging.notice(cmd) - discard execShellCmd(cmd) - else: - minilogger.notice("$# generated successfully, call the nim compiler to compile it.") + let cmd = "nim c $#$#" % [NIMOPTIONS&" ", nimFile] + logging.notice("Calling Nim compiler:") + logging.notice(cmd) + discard execShellCmd(cmd) else: result = result.concat(i.compileFile(main)) except:

@@ -246,10 +235,7 @@ var contents = ""

try: fileLines = fn.readFile().splitLines() except: - when defined(mini): - minilogger.fatal("Cannot read from file: " & fn) - else: - logging.fatal("Cannot read from file: " & fn) + logging.fatal("Cannot read from file: " & fn) quit(3) if fileLines[0].len >= 2 and fileLines[0][0..1] == "#!": contents = ";;\n" & fileLines[1..fileLines.len-1].join("\n")

@@ -258,9 +244,8 @@ contents = fileLines.join("\n")

minStream(newStringStream(contents), fn, op, main) when isMainModule: - when not defined(mini): - import terminal import + terminal, parseopt, critbits, minpkg/core/meta

@@ -345,7 +330,7 @@ var i = newMinInterpreter(filename = "<repl>")

i.minSimpleRepl() - let usage* = """ $exe v$version - a tiny concatenative programming language + let usage* = """ $exe v$version - a small but practical concatenative programming language (c) 2014-2021 Fabio Cevasco Usage:

@@ -374,10 +359,7 @@ ]

var file, s: string = "" var args = newSeq[string](0) - when defined(mini): - minilogger.setLogFilter(minilogger.lvlNotice) - else: - logging.setLogFilter(logging.lvlNotice) + logging.setLogFilter(logging.lvlNotice) var p = initOptParser() for kind, key, val in getopt(p):

@@ -399,10 +381,7 @@ customPrelude = val

of "log", "l": if file == "": var val = val - when defined(mini): - minilogger.setLogLevel(val) - else: - niftylogger.setLogLevel(val) + niftylogger.setLogLevel(val) of "passN", "n": NIMOPTIONS = val of "evaluate", "e":

@@ -417,7 +396,7 @@ if file == "":

echo pkgVersion quit(0) of "interactive", "i": - if file == "" and not defined(mini): + if file == "": REPL = true of "interactive-simple", "j": if file == "":
M min.nimblemin.nimble

@@ -13,7 +13,7 @@ installDirs = @["minpkg"]

# Dependencies -requires "nim >= 1.4.0" +requires "nim >= 1.4.0", "zippy" before install: exec "nimble install -y nifty"
M min.vimmin.vim

@@ -1,8 +1,8 @@

" Vim syntax file " Language: min " Maintainer: Fabio Cevasco -" Last Change: 06 Mar 2021 -" Version: 0.34.0 +" Last Change: 15 Mar 2021 +" Version: 0.35.0 if exists("b:current_syntax") finish

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

setl iskeyword=@,36-39,+,-,*,.,/,:,~,!,48-57,60-65,94-95,192-255 setl iskeyword+=^ -syntax keyword minDefaultSymbol ! != $ % & && ' * + - -> -inf . .. / : :: < <= =% =-= == ==> => =~ > >< >= >> ? @ ROOT ^ abs accept acos aes all? and any? append apply apply-interpolate args asin ask atan atime avg bind bitand bitnot bitor bitxor boolean boolean? capitalize case cd ceil chmod choose chr clear clear-stack cleave close column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug decode decode-url define defined-sigil? defined-symbol? delete-sigil delete-symbol dequote dget dhas? dict dictionary? difference dip dir? dirname div dkeys download dpairs dpick drop dsdelete dset dsget dshas? dsinit dspost dsput dsquery dsread dstore dswrite dtype dup dvalues e encode encode-url env? error escape eval even? exists? exit expect expect-all expect-any expect-empty-stack fappend fatal file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-yaml fs fsize fstats ftype fwrite get get-content get-env get-stack getchr gets hardlink harvest help hidden? http id if import in? indent indexof inf infix-dequote info insert integer integer? interpolate intersection invoke io join keep lambda lambda-bind last length line-info linrec listen lite? ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match? math md4 md5 med mini? mkdir mod mtime mv nan net newline nip not notice now null? num number? odd? one? operator opts or ord os over parent-scope parse parse-url partition password pi pick pop pow pred prefix prefix-dequote prepend print product prompt publish put-env putchr puts quit quotation? quote quote-map quotesym r2g raise random randomize range raw-args recv recv-line reduce reject remove remove-symbol repeat replace replace-apply request require rest return reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal-sigil seal-symbol sealed-sigil? sealed-symbol? search search-all semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack sha1 sha224 sha256 sha384 sha512 shl shorten shr sigil-help sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server stop-server str string string? stringlike? strip substr succ suffix sum swap swons symbol-help symbols symlink symlink? symmetric-difference sys system take tan tanh tap tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-yaml trunc try type type? typealias union unless unmapkey unseal-sigil unseal-symbol unzip uppercase version warn when which while with xor zip || ~ +syntax keyword minDefaultSymbol ! != $ % & && ' * + - -> -inf . .. / : :: < <= =% =-= == ==> => =~ > >< >= >> ? @ ROOT ^ _demo _dev _github _min _one _scripts _shell abs accept acos aes all? and any? append apply apply-interpolate args asin ask atan atime avg bind bitand bitnot bitor bitxor boolean boolean? capitalize case cd ceil chmod choose chr clear clear-stack cleave close cmd column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug decode decode-url define defined-sigil? defined-symbol? delete-sigil delete-symbol dequote devconfig dget dhas? dict dictionary? difference dip dir? dirname div dkeys download dpairs dpick drop dsdelete dset dsget dshas? dsinit dspost dsput dsquery dsread dstore dswrite dtype dup dvalues e encode encode-url env? error escape eval even? exists? exit expect expect-all expect-any expect-empty-stack fappend fatal file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-yaml fs fsize fstats ftype fwrite get get-content get-env get-stack getchr gets hardlink harvest help hidden? http id if import in? indent indexof inf infix-dequote info insert integer integer? interpolate intersection invoke io join keep lambda lambda-bind last length line-info linrec listen lite? ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match? math md4 md5 med min_symbols mini? minrc mkdir mod mtime mv nan net netstart netstop newline nip not notice now null? num number? odd? one? operator opts or ord os over parent-scope parse parse-url partition password pi pick pop pow pred prefix prefix-dequote prepend print product prompt publish put-env putchr puts quit quotation? quote quote-map quotesym r2g raise random randomize range raw-args rebuild recv recv-line reduce reject remove remove-symbol repeat replace replace-apply request require rest restart return reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal-sigil seal-symbol sealed-sigil? sealed-symbol? search search-all semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack sha1 sha224 sha256 sha384 sha512 shl shorten shr sigil-help sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server startshell stop-server stopshell str string string? stringlike? strip substr succ suffix sum swap swons symbol-help symbols symdir symlink symlink? symmetric-difference sys system take tan tanh tap tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-yaml tobin trunc try type type? typealias union unless unmapkey unseal-sigil unseal-symbol unzip uppercase version vscode warn when which while with xor zip || ~ syntax match minDefaultSigil ;\<[/:@'~!?$%&=<>#^*#+]; contained syntax match minQuote ;\<['];
M min.ymlmin.yml

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

author: Fabio Cevasco -description: A tiny concatenative programming language and shell. -id: 38026834 +description: A small but practical concatenative programming language and shell. +id: 39805166 name: min -version: 0.34.1+version: 0.35.0
M minNotepad++.xmlminNotepad++.xml

@@ -29,7 +29,7 @@ <Keywords name="Keywords2">== &gt;= &lt;= &gt; &lt; != and expect-all expect-any or not xor</Keywords>

<Keywords name="Keywords3">: + @ = # ~ ^ * &gt; &lt; / ? % $ ! &amp;</Keywords> <Keywords name="Keywords4">eval exit ROOT version</Keywords> <Keywords name="Keywords5">-&gt; =&gt;</Keywords> - <Keywords name="Keywords6">compiled? defined-symbol? lite? loglevel? all? any? in? dhas? hidden? boolean? dictionary? float? integer? null? number? quotation? type? semver? env? dir? exists? file? symlink? stringlike? even? odd? sealed-symbol?</Keywords> + <Keywords name="Keywords6">compiled? defined-symbol? loglevel? all? any? in? dhas? hidden? boolean? dictionary? float? integer? null? number? quotation? type? semver? env? dir? exists? file? symlink? stringlike? even? odd? sealed-symbol?</Keywords> <Keywords name="Keywords7">puts! tap! debug! error! info! notice! print! warning! system!</Keywords> <Keywords name="Keywords8">+ - -inf * / inf nan randomize e pi</Keywords> <Keywords name="Delimiters">00&quot; 01 02&quot; 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
M minpkg/core/interpreter.nimminpkg/core/interpreter.nim

@@ -83,9 +83,8 @@ i.scope = origScope

proc newMinInterpreter*(filename = "input", pwd = ""): MinInterpreter = var path = pwd - when not defined(mini): - if not pwd.isAbsolute: - path = joinPath(getCurrentDir(), pwd) + if not pwd.isAbsolute: + path = joinPath(getCurrentDir(), pwd) var stack:MinStack = newSeq[MinValue](0) var trace:MinStack = newSeq[MinValue](0) var stackcopy:MinStack = newSeq[MinValue](0)

@@ -105,9 +104,8 @@ return i

proc copy*(i: MinInterpreter, filename: string): MinInterpreter = var path = filename - when not defined(mini): - if not filename.isAbsolute: - path = joinPath(getCurrentDir(), filename) + if not filename.isAbsolute: + path = joinPath(getCurrentDir(), filename) result = newMinInterpreter() result.filename = filename result.pwd = path.parentDirEx

@@ -356,7 +354,7 @@

proc initCompiledFile*(i: In, files: seq[string]): seq[string] {.discardable.} = result = newSeq[string](0) result.add "import min" - if files.len > 0 or (ASSETPATH != "" and not defined(mini)): + if files.len > 0 or (ASSETPATH != ""): result.add "import critbits" if ASSETPATH != "": result.add "import base64"
M minpkg/lib/min_lang.nimminpkg/lib/min_lang.nim

@@ -4,19 +4,13 @@ strutils,

sequtils, json, parseopt, - algorithm -when defined(mini): - import - rdstdin, - ../core/minilogger -else: - import - os, - logging, - ../core/baseutils, - ../packages/niftylogger, - ../packages/nimline/nimline, - ../packages/nim-sgregex/sgregex + algorithm, + os, + logging, + ../core/baseutils, + ../packages/niftylogger, + ../packages/nimline/nimline, + ../packages/nim-sgregex/sgregex import ../core/env, ../core/meta,

@@ -32,107 +26,105 @@

const HELPFILE = "../../help.json".slurp let HELP = HELPFILE.parseJson - when not defined(mini): - - def.symbol("from-json") do (i: In) {.gcsafe.}: - let vals = i.expect("str") - let s = vals[0] - i.push i.fromJson(s.getString.parseJson) - - def.symbol("to-json") do (i: In): - let vals = i.expect "a" - let q = vals[0] - i.push(($((i%q).pretty)).newVal) - - # Save/load symbols - - def.symbol("save-symbol") do (i: In) {.gcsafe.}: - let vals = i.expect("'sym") - let s = vals[0] - let sym = s.getString - let op = i.scope.getSymbol(sym) - if op.kind == minProcOp: - raiseInvalid("Symbol '$1' cannot be serialized." % sym) - let json = MINSYMBOLS.readFile.parseJson - json[sym] = i%op.val - MINSYMBOLS.writeFile(json.pretty) + def.symbol("from-json") do (i: In) {.gcsafe.}: + let vals = i.expect("str") + let s = vals[0] + i.push i.fromJson(s.getString.parseJson) + + def.symbol("to-json") do (i: In): + let vals = i.expect "a" + let q = vals[0] + i.push(($((i%q).pretty)).newVal) - def.symbol("load-symbol") do (i: In): - let vals = i.expect("'sym") - let s = vals[0] - let sym = s.getString - let json = MINSYMBOLS.readFile.parseJson - if not json.hasKey(sym): - raiseUndefined("Symbol '$1' not found." % sym) - let val = i.fromJson(json[sym]) - i.scope.symbols[sym] = MinOperator(kind: minValOp, val: val, quotation: true) + # Save/load symbols - def.symbol("saved-symbols") do (i: In): - var q = newSeq[MinValue](0) - let json = MINSYMBOLS.readFile.parseJson - for k,v in json.pairs: - q.add k.newVal - i.push q.newVal + def.symbol("save-symbol") do (i: In) {.gcsafe.}: + let vals = i.expect("'sym") + let s = vals[0] + let sym = s.getString + let op = i.scope.getSymbol(sym) + if op.kind == minProcOp: + raiseInvalid("Symbol '$1' cannot be serialized." % sym) + let json = MINSYMBOLS.readFile.parseJson + json[sym] = i%op.val + MINSYMBOLS.writeFile(json.pretty) + + def.symbol("load-symbol") do (i: In): + let vals = i.expect("'sym") + let s = vals[0] + let sym = s.getString + let json = MINSYMBOLS.readFile.parseJson + if not json.hasKey(sym): + raiseUndefined("Symbol '$1' not found." % sym) + let val = i.fromJson(json[sym]) + i.scope.symbols[sym] = MinOperator(kind: minValOp, val: val, quotation: true) + + def.symbol("saved-symbols") do (i: In): + var q = newSeq[MinValue](0) + let json = MINSYMBOLS.readFile.parseJson + for k,v in json.pairs: + q.add k.newVal + i.push q.newVal + + def.symbol("remove-symbol") do (i: In): + let vals = i.expect("'sym") + let s = vals[0] + let sym = s.getString + var json = MINSYMBOLS.readFile.parseJson + if not json.hasKey(sym): + raiseUndefined("Symbol '$1' not found." % sym) + json.delete(sym) + MINSYMBOLS.writeFile(json.pretty) - def.symbol("remove-symbol") do (i: In): - let vals = i.expect("'sym") - let s = vals[0] - let sym = s.getString - var json = MINSYMBOLS.readFile.parseJson - if not json.hasKey(sym): - raiseUndefined("Symbol '$1' not found." % sym) - json.delete(sym) - MINSYMBOLS.writeFile(json.pretty) + def.symbol("load") do (i: In): + let vals = i.expect("'sym") + let s = vals[0] + var file = s.getString + if not file.endsWith(".min"): + file = file & ".min" + info("[load] File: ", file) + let f = simplifyPath(i.filename, file) + if MINCOMPILED and COMPILEDMINFILES.hasKey(f): + var i2 = i.copy(f) + i2.withScope(): + COMPILEDMINFILES[f](i2) + i = i2.copy(i.filename) + return + else: + if not f.fileExists: + raiseInvalid("File '$1' does not exist." % file) + i.load f - def.symbol("load") do (i: In): - let vals = i.expect("'sym") - let s = vals[0] - var file = s.getString - if not file.endsWith(".min"): - file = file & ".min" - info("[load] File: ", file) - let f = simplifyPath(i.filename, file) - if MINCOMPILED and COMPILEDMINFILES.hasKey(f): - var i2 = i.copy(f) - i2.withScope(): + def.symbol("require") do (i: In): + let vals = i.expect("'sym") + let s = vals[0] + var file = s.getString + if not file.endsWith(".min"): + file = file & ".min" + info("[require] File: ", file) + let f = simplifyPath(i.filename, file) + if MINCOMPILED and COMPILEDMINFILES.hasKey(f): + var i2 = i.copy(f) + i2.withScope(): + var mdl: MinValue + if not CACHEDMODULES.hasKey(f): COMPILEDMINFILES[f](i2) - i = i2.copy(i.filename) - return - else: - if not f.fileExists: - raiseInvalid("File '$1' does not exist." % file) - i.load f + CACHEDMODULES[f] = newDict(i2.scope) + CACHEDMODULES[f].objType = "module" + mdl = CACHEDMODULES[f] + for key, value in i2.scope.symbols.pairs: + mdl.scope.symbols[key] = value + i.push(mdl) + else: + if not f.fileExists: + raiseInvalid("File '$1' does not exist." % file) + i.push i.require(f) - def.symbol("require") do (i: In): - let vals = i.expect("'sym") - let s = vals[0] - var file = s.getString - if not file.endsWith(".min"): - file = file & ".min" - info("[require] File: ", file) - let f = simplifyPath(i.filename, file) - if MINCOMPILED and COMPILEDMINFILES.hasKey(f): - var i2 = i.copy(f) - i2.withScope(): - var mdl: MinValue - if not CACHEDMODULES.hasKey(f): - COMPILEDMINFILES[f](i2) - CACHEDMODULES[f] = newDict(i2.scope) - CACHEDMODULES[f].objType = "module" - mdl = CACHEDMODULES[f] - for key, value in i2.scope.symbols.pairs: - mdl.scope.symbols[key] = value - i.push(mdl) - else: - if not f.fileExists: - raiseInvalid("File '$1' does not exist." % file) - i.push i.require(f) - - def.symbol("raw-args") do (i: In): - var args = newSeq[MinValue](0) - for par in commandLineParams(): - args.add par.newVal - i.push args.newVal + def.symbol("raw-args") do (i: In): + var args = newSeq[MinValue](0) + for par in commandLineParams(): + args.add par.newVal + i.push args.newVal def.symbol("with") do (i: In): let vals = i.expect("dict", "quot")

@@ -160,8 +152,6 @@ i.evaluating = false

i.scope = origscope qscope.scope.symbols[sym] = MinOperator(kind: minProcOp, prc: op) - ### End of symbols not present in minimin - def.symbol("operator") do (i: In): let vals = i.expect("quot"); let q = vals[0]

@@ -176,9 +166,8 @@

if not nv.isSymbol: raiseInvalid("Operator name must be a symbol") var n = nv.symVal - when not defined(mini): - if not n.match(USER_SYMBOL_REGEX): - raiseInvalid("Operator name must not contain invalid characters") + if not n.match(USER_SYMBOL_REGEX): + raiseInvalid("Operator name must not contain invalid characters") if t == "typeclass": n = "typeclass:"&n # Validate signature

@@ -345,11 +334,8 @@ let a = i.peek

echo $$a def.symbol("gets") do (i: In) {.gcsafe.}: - when defined(mini): - i.push readLineFromStdin("").newVal - else: - var ed = initEditor() - i.push ed.readLine().newVal + var ed = initEditor() + i.push ed.readLine().newVal def.symbol("apply") do (i: In): let vals = i.expect("quot")

@@ -406,12 +392,6 @@ for s in m.scope.sigils.keys:

q.add s.newVal i.push q.newVal - def.symbol("lite?") do (i: In): - i.push defined(lite).newVal - - def.symbol("mini?") do (i: In): - i.push defined(mini).newVal - def.symbol("from-yaml") do (i: In): let vals = i.expect("str") let s = vals[0]

@@ -448,16 +428,10 @@ def.symbol("loglevel") do (i: In):

let vals = i.expect("'sym") let s = vals[0] var str = s.getString - when defined(mini): - echo "Log level: ", minilogger.setLogLevel(str) - else: - echo "Log level: ", niftylogger.setLogLevel(str) + echo "Log level: ", niftylogger.setLogLevel(str) def.symbol("loglevel?") do (i: In): - when defined(mini): - i.push minilogger.getLogLevel().newVal - else: - i.push niftylogger.getLogLevel().newVal + i.push niftylogger.getLogLevel().newVal # Language constructs

@@ -469,9 +443,8 @@ var symbol: string

var isQuot = q1.isQuotation q1 = @[q1].newVal symbol = sym.getString - when not defined(mini): - if not symbol.match USER_SYMBOL_REGEX: - raiseInvalid("Symbol identifier '$1' contains invalid characters." % symbol) + if not symbol.match USER_SYMBOL_REGEX: + raiseInvalid("Symbol identifier '$1' contains invalid characters." % symbol) info "[define] $1 = $2" % [symbol, $q1] if i.scope.symbols.hasKey(symbol) and i.scope.symbols[symbol].sealed: raiseUndefined("Attempting to redefine sealed symbol '$1'" % [symbol])

@@ -484,9 +457,8 @@ var s = vals[1].getString

if not i.validType(s): raiseInvalid("Invalid type expression: $#" % s) let symbol = "typealias:"&sym - when not defined(mini): - if not sym.match USER_SYMBOL_REGEX: - raiseInvalid("Symbol identifier '$1' contains invalid characters." % sym) + if not sym.match USER_SYMBOL_REGEX: + raiseInvalid("Symbol identifier '$1' contains invalid characters." % sym) info "[typealias] $1 = $2" % [sym, s] if i.scope.symbols.hasKey(symbol) and i.scope.symbols[symbol].sealed: raiseUndefined("Attempting to redefine sealed symbol '$1'" % [symbol])

@@ -498,9 +470,8 @@ let sym = vals[0]

var q1 = vals[1] var symbol: string symbol = sym.getString - when not defined(mini): - if not symbol.match USER_SYMBOL_REGEX: - raiseInvalid("Symbol identifier '$1' contains invalid characters." % symbol) + if not symbol.match USER_SYMBOL_REGEX: + raiseInvalid("Symbol identifier '$1' contains invalid characters." % symbol) info "[lambda] $1 = $2" % [symbol, $q1] if i.scope.symbols.hasKey(symbol) and i.scope.symbols[symbol].sealed: raiseUndefined("Attempting to redefine sealed symbol '$1'" % [symbol])

@@ -957,11 +928,10 @@ def.symbol("unseal-sigil") do (i: In):

let vals = i.expect("'sym") let sym = vals[0].getString var s = i.scope.getSigil(sym) - when not defined(mini): - if not sym.match USER_SYMBOL_REGEX: - # Prevent accidentally unsealing system sigils - # Not that they can redefined, but still - raiseInvalid("Attempting to unseal system sigil: " & sym) + if not sym.match USER_SYMBOL_REGEX: + # Prevent accidentally unsealing system sigils + # Not that they can redefined, but still + raiseInvalid("Attempting to unseal system sigil: " & sym) s.sealed = false i.scope.setSigil(sym, s, true)

@@ -1085,10 +1055,7 @@ else:

raiseInvalid("Cannot convert a quotation to float.") def.symbol("prompt") do (i: In): - when defined(mini): - i.push "$ ".newVal - else: - i.eval(""""[$1]\n$$ " (.) => %""") + i.eval(""""[$1]\n$$ " (.) => %""") def.symbol("quotesym") do (i: In): let vals = i.expect("str")
M minpkg/lib/min_sys.nimminpkg/lib/min_sys.nim

@@ -3,9 +3,8 @@ os,

osproc, strutils, critbits, - logging -when not defined(lite): - import sequtils + logging, + tables import ../core/parser, ../core/env,

@@ -14,8 +13,7 @@ ../core/interpreter,

../core/utils, ../core/fileutils -when not defined(lite): - import ../packages/nim-miniz/src/nim_miniz +import zippy/ziparchives proc unix(s: string): string = return s.replace("\\", "/")

@@ -225,18 +223,28 @@

def.sigil("&") do (i: In): i.pushSym("run") - when not defined(lite): - def.symbol("unzip") do (i: In): - let vals = i.expect("'sym", "'sym") - let dir = vals[0] - let f = vals[1] - nim_miniz.unzip(f.getString, dir.getString) + def.symbol("unzip") do (i: In): + let vals = i.expect("'sym", "'sym") + var dir = vals[0].getString + let f = vals[1].getString + if dir.len < 1: + raiseInvalid("No destination directory was specified.") + if dir[0] != '.' and dir.len > 1 and dir[1] != '/': + dir = "./" & dir + extractAll(f, dir) - def.symbol("zip") do (i: In): - let vals = i.expect("'sym", "quot") - let file = vals[0] - let files = vals[1] - nim_miniz.zip(files.qVal.mapIt(it.getString), file.getString) + def.symbol("zip") do (i: In): + let vals = i.expect("'sym", "quot") + let file = vals[0] + let files = vals[1] + let archive = ZipArchive() + for rawEntry in files.qVal: + let entry = rawEntry.getString.relativePath(getCurrentDir()) + if entry.dirExists: + archive.addDir(entry) + else: + archive.contents[entry] = ArchiveEntry(contents: readFile(entry)) + archive.writeZipArchive(file.getString) def.finalize("sys")
M next-release.mdnext-release.md

@@ -1,3 +1,11 @@

-### Fixes +### BREAKING CHANGES -* Fixed **search** symbol to always return a quotation containing the same number of elements (1 + number of captures). If no matches are found, the quotation contains empty strings. +* Removed **lite?** and **mini?** symbols, as they are no longer necessary. + +### New Features + +* Now using [zippy](https://github.com/guzba/zippy) for the **zip** and **unzip** symbols. + +### Fixes and Improvements + +* Removed conditional compilations related to mini and lite variants as they are no longer needed.
M nifty.jsonnifty.json

@@ -38,16 +38,6 @@ }

} }, "packages": { - "nim-sgregex": { - "name": "nim-sgregex", - "src": "https://github.com/h3rald/nim-sgregex.git", - "git": true - }, - "nim-miniz": { - "name": "nim-miniz", - "src": "https://github.com/h3rald/nim-miniz.git", - "git": true - }, "nimline": { "name": "nimline", "src": "https://github.com/h3rald/nimline.git",

@@ -59,4 +49,4 @@ "src": "https://raw.githubusercontent.com/h3rald/nifty/master/src/niftypkg/niftylogger.nim",

"curl": true } } -} +}
M prelude.minprelude.min

@@ -6,21 +6,13 @@ 'stack import

'seq import 'dict import 'time import -(mini?) ( - ( - 'io import - 'fs import - 'sys import - 'dstore import - ) ROOT with -) unless -(lite? mini? or) ( - ( - 'crypto import - 'math import - 'net import - 'http import - ) ROOT with -) unless +'io import +'fs import +'sys import +'dstore import +'crypto import +'math import +'net import +'http import ; Unseal prompt symbol 'prompt unseal-symbol
M site/contents/about.mdsite/contents/about.md

@@ -19,7 +19,7 @@ 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 [concatenative](http://concatenative.org/wiki/view/Front%20Page) programming language out there -- so people are likely to be _less_ pissed off than if I made a yet another Lisp instead.

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. -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's a good compromise compared to the alternatives out there, considering that you only need _one file_ to run any min program. +Additionally, I wanted it to be fully self-contained, cross-platform, and small. Not stupidly small, but I feel it's a good compromise compared to the alternatives out there, considering that you only need _one file_ to run any min program. I also created a static site generator called [HastySite](https://github.com/h3rald/hastysite), which also powers <https://min-lang.org>. HastySite internally uses min as the language to write the [rules](https://github.com/h3rald/min/blob/master/site/rules.min) to process the source files of the site, and also all its [scripts](https://github.com/h3rald/min/tree/master/site/scripts).
M site/contents/learn-extending.mdsite/contents/learn-extending.md

@@ -49,19 +49,15 @@ 'seq import

'dict import 'time import 'fs import -'lite? ( - ( - 'crypto import - 'math import - 'net import - 'http import - ) ROOT with -) unless +'crypto import +'math import +'net import +'http import ; Unseal prompt symbol 'prompt unseal-symbol ``` -Essentially, this causes min to import *all* the modules (except for some if the **lite** flag was defined at compilation time) and unseals the {#link-operator||lang||prompt#} symbol so that it can be customized. If you want, you can provide your own prelude file to specify your custom behaviors, selectively import modules, and define your own symbols, like this: +Essentially, this causes min to import *all* the modules and unseals the {#link-operator||lang||prompt#} symbol so that it can be customized. If you want, you can provide your own prelude file to specify your custom behaviors, selectively import modules, and define your own symbols, like this: > %min-terminal% > [$](class:prompt) min -i -p:myfile.min
M site/contents/reference-lang.mdsite/contents/reference-lang.md

@@ -250,9 +250,6 @@ > >

> > 5 (dup 0 ==) 'succ (dup pred) '* linrec #} -{#op||lite?||{{none}}||{{b}}|| -Returns {{t}} if min was built in _lite_ mode. #} - {#op||load||{{sl}}||{{a0p}}|| Parses and interprets the specified {{m}} file {{sl}}, adding [.min](class:ext) if not specified. #}

@@ -534,19 +531,4 @@ > > (count 10 <=)

> > (count puts succ @count) while #} {#op||with||{{q1}} {{q2}}||{{a0p}}|| -Pushes each item of {{q1}} on the stack using the scope of {{q2}} as scope. - -> > %sidebar% -> > Example -> > -> > This operator is useful to define symbols on the [ROOT](class:kwd) scope or another scope. For example min's prelude includes the following code used to import certain modules only if min was not compiled in lite mode: -> > -> > 'lite? ( -> > ( -> > 'crypto import -> > 'math import -> > 'net import -> > 'http import -> > ) ROOT with -> > ) unless - #} +Pushes each item of {{q1}} on the stack using the scope of {{q2}} as scope. #}
M site/settings.jsonsite/settings.json

@@ -6,5 +6,5 @@ "rules": "rules.min",

"temp": "temp", "templates": "templates", "title": "min language", - "version": "0.34.1" + "version": "0.35.0" }
M tasks/data/doc-snippets.jsontasks/data/doc-snippets.json

@@ -59,5 +59,5 @@ "sock1": "dict:socket1",

"sock2": "dict:socket2", "m": "min", "no-win": "(not supported on Windows systems)", - "sgregex": "sgregex" + "pcre": "Perl-compatible regular expression" }
M tests/lang.mintests/lang.min

@@ -196,8 +196,6 @@ (3.4 "test" 1 (int str num) expect (3.4 "test" 1) ==) *test/assert

("aaa bbb ccc 2 2 + (2 3 4)" parse (aaa bbb ccc 2 2 + (2 3 4)) ==) *test/assert - (lite? false ==) *test/assert - ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) *test/assert ((2 < 3 and (4 > 2)) >< true) *test/assert