Enhanced vim syntax file, enhanced highlighter.
@@ -128,14 +128,14 @@ "module": "global",
"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", "module": "global", "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", "module": "global", "name": "<=",@@ -174,7 +174,7 @@ "module": "global",
"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", "module": "global", "name": ">",@@ -187,7 +187,7 @@ "module": "global",
"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", "module": "global", "name": ">=",@@ -351,7 +351,7 @@ "name": "bitxor",
"signature": "int1 int2 ==> int3" }, "boolean": { - "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", "module": "global", "name": "boolean",@@ -372,7 +372,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 (\n ((2 3) (\"Greater than 3\" put!))\n ((2 < 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 (\r\n ((2 3) (\"Greater than 3\" put!))\r\n ((2 < 3) (\"Smaller than 3\" put!))\r\n ((true) (\"Exactly 3\" put!))\r\n ) case", "kind": "symbol", "module": "global", "name": "case",@@ -398,6 +398,13 @@ "kind": "symbol",
"module": "global", "name": "concat", "signature": "quot1 quot2 ==> quot3" + }, + "constructor": { + "description": "Symbol used to define a constructor when using the operator symbol.", + "kind": "symbol", + "module": "global", + "name": "constructor", + "signature": " ==> " }, "crypto.aes": { "description": "Encrypts or decrypts 'sym1 using the Advanced Encryption Standard (AES) in CTR mode, using 'sym2 as password.",@@ -519,7 +526,7 @@ "name": "delete-symbol",
"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", "module": "global", "name": "dequote",@@ -568,7 +575,7 @@ "name": "get-raw",
"signature": "dict 'sym ==> dict:rawval" }, "dict.has?": { - "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 dict.has?", + "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 dict.has?", "kind": "symbol", "module": "dict", "name": "has?",@@ -582,14 +589,14 @@ "name": "keys",
"signature": "dict ==> (str*)" }, "dict.pairs": { - "description": "Returns a quotation containing a quotation for each value/key pair (value first, key second) of dictionary dict. \n \n \n Example\n\n A The following program returns ((1 \"a\") (2 \"b\")):\n {1 :a 2 :b} dict.pairs", + "description": "Returns a quotation containing a quotation for each value/key pair (value first, key second) of dictionary dict. \r\n \r\n \r\n Example\r\n\r\n A The following program returns ((1 \"a\") (2 \"b\")):\r\n {1 :a 2 :b} dict.pairs", "kind": "symbol", "module": "dict", "name": "pairs", "signature": "dict ==> (a*)" }, "dict.pick": { - "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\") dict.pick", + "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\") dict.pick", "kind": "symbol", "module": "dict", "name": "pick",@@ -631,7 +638,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", "module": "global", "name": "difference",@@ -687,7 +694,7 @@ "name": "exit",
"signature": "int ==> " }, "expect": { - "description": "If the -d (--dev) flag is specified when running the program, 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). If the -d (--dev) flag is not specified when running the program, no validation is performed and all elements are just returned in a quotation 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": "If the -d (--dev) flag is specified when running the program, 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). If the -d (--dev) flag is not specified when running the program, no validation is performed and all elements are just returned in a quotation 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", "module": "global", "name": "expect",@@ -715,14 +722,14 @@ "name": "expect-empty-stack",
"signature": " ==> " }, "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 (stackdup 20 < stack.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 (stackdup 20 < stack.swap even? and) filter", "kind": "symbol", "module": "global", "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", "module": "global", "name": "find",@@ -736,14 +743,14 @@ "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", "module": "global", "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", "module": "global", "name": "float",@@ -764,7 +771,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", "module": "global", "name": "format-error",@@ -806,14 +813,14 @@ "name": "from-oct",
"signature": "'sym ==> int" }, "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", "module": "global", "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", "module": "global", "name": "from-yaml",@@ -960,7 +967,7 @@ "name": "size",
"signature": "'sym ==> int" }, "fs.stats": { - "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\" fs.stats\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\" fs.stats\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", "module": "fs", "name": "stats",@@ -1023,7 +1030,7 @@ "name": "gets",
"signature": " ==> str" }, "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", "module": "global", "name": "harvest",@@ -1051,14 +1058,14 @@ "name": "get-content",
"signature": "str1 ==> str2" }, "http.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\" 'method dict.get\n \"http://httpbin.org/ip\" 'url dict.set\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\" 'method dict.get\r\n \"http://httpbin.org/ip\" 'url dict.set\r\n request", "kind": "symbol", "module": "http", "name": "request", "signature": "dict ==> dict:http-response" }, "http.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 ⇒ 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 'body dict.set\n stack.dup puts!\n )\n ; The request handler is ready, give it the name handler\n :handler\n \n ; Create the parameter dictionary for the server\n {}\n handler 'handler dict.set\n 5555 'port dict.set\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 ⇒ 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 'body dict.set\r\n stack.dup puts!\r\n )\r\n ; The request handler is ready, give it the name handler\r\n :handler\r\n \r\n ; Create the parameter dictionary for the server\r\n {}\r\n handler 'handler dict.set\r\n 5555 'port dict.set\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", "module": "http", "name": "start-server",@@ -1114,7 +1121,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", "module": "global", "name": "infix-dequote",@@ -1128,7 +1135,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", "module": "global", "name": "integer",@@ -1142,14 +1149,14 @@ "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.\" (sys.pwd (sys.pwd sys.ls 'fs.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.\" (sys.pwd (sys.pwd sys.ls 'fs.file? filter size)) apply interpolate\r\n \r\n produces:\r\n \r\n \"Directory '/Users/h3rald/Development/min' includes 19 files.\"", "kind": "symbol", "module": "global", "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", "module": "global", "name": "intersection",@@ -1163,7 +1170,7 @@ "name": "ask",
"signature": "str1 ==> str2" }, "io.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", "module": "io", "name": "choose",@@ -1191,7 +1198,7 @@ "name": "column-print",
"signature": "quot int ==> a" }, "io.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", "module": "io", "name": "confirm",@@ -1233,7 +1240,7 @@ "name": "info",
"signature": "a ==> a" }, "io.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 [minline](https://h3rald.com/minline/minline.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 io.mapkey \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 [minline](https://h3rald.com/minline/minline.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 io.mapkey \r\n \r\n causes the CTRL+L key to clear the screen.", "kind": "symbol", "module": "io", "name": "mapkey",@@ -1261,7 +1268,7 @@ "name": "putchr",
"signature": "str ==> a" }, "io.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 [minline](https://h3rald.com/minline/minline.html) library are supported.\n * At present, all the default mappings of min are those provided by the [minline](https://h3rald.com/minline/minline.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 [minline](https://h3rald.com/minline/minline.html) library are supported.\r\n * At present, all the default mappings of min are those provided by the [minline](https://h3rald.com/minline/minline.html) library.", "kind": "symbol", "module": "io", "name": "unmapkey",@@ -1282,7 +1289,7 @@ "name": "join",
"signature": "quot 'sym ==> str" }, "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 \n Essentially, 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\n Essentially, this symbol allows you to define an operator without any validation of constraints and bind it to a symbol.", "kind": "symbol", "module": "global", "name": "lambda",@@ -1317,7 +1324,7 @@ "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", "module": "global", "name": "linrec",@@ -1338,7 +1345,7 @@ "name": "load-symbol",
"signature": "'sym ==> a*" }, "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", "module": "global", "name": "loglevel",@@ -1366,14 +1373,14 @@ "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 (stack.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 (stack.dup *) (+) map-reduce", "kind": "symbol", "module": "global", "name": "map-reduce", "signature": "quot1 quot2 quot3 ==> int" }, "match?": { - "description": "Returns true if str2 matches str1, false otherwise.\n \n Tip\n \n str2 is a Perl-compatible regular expression", + "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", "module": "global", "name": "match?",@@ -1583,14 +1590,14 @@ "name": "close",
"signature": "dict:socket ==> " }, "net.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 {} net.socket \"localhost\" 7777 net.connect :cli\n \n args 1 get :msg\n \n \"Sending message \\\"$1\\\" to localhost:7777...\" (msg) = net.send\n \n \"Done.\" puts!\n \n cli net.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 {} net.socket \"localhost\" 7777 net.connect :cli\r\n \r\n args 1 get :msg\r\n \r\n \"Sending message \\\"$1\\\" to localhost:7777...\" (msg) = net.send\r\n \r\n \"Done.\" puts!\r\n \r\n cli net.close", "kind": "symbol", "module": "net", "name": "connect", "signature": "dict:socket str int ==> dict:socket" }, "net.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 {} net.socket {\"127.0.0.1\" :address 7777 :port} net.listen :srv\n \n \"Server listening on localhost:7777\" puts!\n \n {} net.socket :cli\n \"\" :line\n (line \"exit\" !=)\n (\n srv cli net.accept #cli\n cli net.recv-line @line\n \"Received: $1\" (line) = % puts!\n ) while\n \n \"Exiting...\" puts!\n \n srv net.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 {} net.socket {\"127.0.0.1\" :address 7777 :port} net.listen :srv\r\n \r\n \"Server listening on localhost:7777\" puts!\r\n \r\n {} net.socket :cli\r\n \"\" :line\r\n (line \"exit\" !=)\r\n (\r\n srv cli net.accept #cli\r\n cli net.recv-line @line\r\n \"Received: $1\" (line) = % puts!\r\n ) while\r\n \r\n \"Exiting...\" puts!\r\n \r\n srv net.close", "kind": "symbol", "module": "net", "name": "listen",@@ -1604,7 +1611,7 @@ "name": "recv",
"signature": "dict:socket int ==> str" }, "net.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 {} net.socket \"httpbin.org\" 80 net.connect :cli\n \n cli \"GET /uuid HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n\" net.send\n \n cli net.recv-line puts :line\n (line \"\\}\" match not) \n (\n cli net.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 {} net.socket \"httpbin.org\" 80 net.connect :cli\r\n \r\n cli \"GET /uuid HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n\" net.send\r\n \r\n cli net.recv-line puts :line\r\n (line \"\\}\" match not) \r\n (\r\n cli net.recv-line puts @line\r\n ) while", "kind": "symbol", "module": "net", "name": "recv-line",@@ -1618,7 +1625,7 @@ "name": "send",
"signature": "dict:socket str ==> " }, "net.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", "module": "net", "name": "socket",@@ -1660,7 +1667,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 operator, 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 * If in development mode (-d or --dev flag specified at run time), 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 elements 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, constructor or typeclass).\r\n * A symbol identifying the name of the operator.\r\n * A quotation defining the signature of the operator, 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 * If in development mode (-d or --dev flag specified at run time), 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 elements 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", "module": "global", "name": "operator",@@ -1709,7 +1716,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", "module": "global", "name": "partition",@@ -1730,7 +1737,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", "module": "global", "name": "prefix-dequote",@@ -1758,12 +1765,19 @@ "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]$$ \" (sys.pwd) = sidebar%\n Example\n \n Publish symbol [my-local-symbol](class:kwd) to [global](class:kwd) scope:\n 'my-local-symbol global publish", + "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]$$ \" (sys.pwd) = %)", "kind": "symbol", "module": "global", "name": "prompt", "signature": " ==> str" }, + "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 [global](class:kwd) scope:\r\n 'my-local-symbol global publish", + "kind": "symbol", + "module": "global", + "name": "publish", + "signature": "'sym dict ==> " + }, "put-env": { "description": "Sets environment variable 'sym2 to 'sym1.", "kind": "symbol",@@ -1835,7 +1849,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", "module": "global", "name": "random",@@ -1870,7 +1884,7 @@ "name": "raw-get",
"signature": "quot int ==> dict:rawval" }, "reduce": { - "description": "Combines each successive element of quot1 using quot2. On the first iteration, the first two inputs processed by quot2 are a1 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 a1 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", "module": "global", "name": "reduce",@@ -1905,21 +1919,21 @@ "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 is a Perl-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", "module": "global", "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 corresponding to each match.\n \n Tip\n \n str2 is a Perl-compatible regular expression.\n \n \n Example\n \n The following:\n \n \":1::2::3::4:\" \":(\\d):\" (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 the full match and the captured matches) are produced as input for the replace quotation: (\"-1-\" \"1\") (\"-2-\" \"2\") (\"-3-\" \"3\") (\"-4-\" \"4\")", + "description": "Returns a copy of str1 containing all occurrences of str2 replaced by applying quot to each quotation corresponding 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):\" (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 the full match and the captured matches) are produced as input for the replace quotation: (\"-1-\" \"1\") (\"-2-\" \"2\") (\"-3-\" \"3\") (\"-4-\" \"4\")", "kind": "symbol", "module": "global", "name": "replace-apply", "signature": "str1 str2 quot ==> str3" }, "require": { - "description": "Parses and interprets (in a separated interpreter) the specified min module, and returns a module dictionary dict containing all the symbols defined in 'sym. \n\nThis symbol will attempt to locate the specified module in this way. Given the following min program:\n\n 'my-module require :my-module\n\n1. Check for a file named my-module in the same folder as the current file (with our without a .min extension).\n2. Check for a file named index.min in the mmm/my-module/*/index.min folder relative to the current file (locally-installed [managed-module](/learn-mmm)).\n3. Check for a file named index.min in the $HOME/mmm/my-module/*/index.min folder (globally-installed [managed-module](/learn-mmm)). If multiple versions of the same module are present, the first one will be loaded.", + "description": "Parses and interprets (in a separated interpreter) the specified min module, and returns a module dictionary dict containing all the symbols defined in 'sym. \r\n\r\nThis symbol will attempt to locate the specified module in this way. Given the following min program:\r\n\r\n 'my-module require :my-module\r\n\r\n1. Check for a file named my-module in the same folder as the current file (with our without a .min extension).\r\n2. Check for a file named index.min in the mmm/my-module/*/index.min folder relative to the current file (locally-installed [managed-module](/learn-mmm)).\r\n3. Check for a file named index.min in the $HOME/mmm/my-module/*/index.min folder (globally-installed [managed-module](/learn-mmm)). If multiple versions of the same module are present, the first one will be loaded.", "kind": "symbol", "module": "global", "name": "require",@@ -1933,7 +1947,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", "module": "global", "name": "return",@@ -1961,7 +1975,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", "module": "global", "name": "scope",@@ -2010,7 +2024,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 * If no matches are found, the quotation contains empty strings.\n \n \n Tip\n \n str2 is a Perl-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", "module": "global", "name": "search",@@ -2086,6 +2100,13 @@ "module": "global",
"name": "shr", "signature": "int1 int2 ==> int3" }, + "sigil": { + "description": "Symbol used to define a sigil when using the operator symbol.", + "kind": "symbol", + "module": "global", + "name": "sigil", + "signature": " ==> " + }, "sigils": { "description": "Returns a list of all sigils defined in the [global](class:kwd) scope.", "kind": "symbol",@@ -2101,14 +2122,14 @@ "name": "size",
"signature": "quot ==> 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", "module": "global", "name": "slice", "signature": "quot1 int1 int2 ==> quot2" }, "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", "module": "global", "name": "sort",@@ -2136,7 +2157,7 @@ "name": "clear",
"signature": "a ==> " }, "stack.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)) stack.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)) stack.cleave /", "kind": "symbol", "module": "stack", "name": "cleave",@@ -2171,7 +2192,7 @@ "name": "get",
"signature": " ==> (a*)" }, "stack.keep": { - "description": "Removes the first element from the stack, dequotes it, and restores the second element.\n \n Example\n \n The following program leaves 5 3 on the stack:\n \n 2 3 '+ stack.keep", + "description": "Removes the first element from the stack, dequotes it, and restores the second 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 '+ stack.keep", "kind": "symbol", "module": "stack", "name": "keep",@@ -2234,7 +2255,7 @@ "name": "sip",
"signature": "quot1 quot2 ==> a* quot1" }, "stack.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)) stack.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)) stack.spread", "kind": "symbol", "module": "stack", "name": "spread",@@ -2297,7 +2318,7 @@ "name": "put",
"signature": "dict:datastore 'sym dict ==> dict:datastore" }, "store.query": { - "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 dget \"h3rald\" ==) dquery", + "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 dget \"h3rald\" ==) dquery", "kind": "symbol", "module": "store", "name": "query",@@ -2373,6 +2394,13 @@ "module": "global",
"name": "sum", "signature": "quot ==> int" }, + "symbol": { + "description": "Symbol used to define a symbol when using the operator symbol.", + "kind": "symbol", + "module": "global", + "name": "symbol", + "signature": " ==> " + }, "symbols": { "description": "Returns a list of all symbols defined in the [global](class:kwd) scope.", "kind": "symbol",@@ -2381,7 +2409,7 @@ "name": "symbols",
"signature": " ==> (str*)" }, "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", "module": "global", "name": "symmetric-difference",@@ -2402,7 +2430,7 @@ "name": "cd",
"signature": "'sym ==> " }, "sys.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 sys.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 sys.chmod\"", "kind": "symbol", "module": "sys", "name": "chmod",@@ -2556,7 +2584,7 @@ "name": "take",
"signature": "quot1 int ==> quot2" }, "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 (stack.dup 'a dict.get succ succ 'a dict.set)\n (stack.dup 'b dict.get succ 'b dict.set)\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 (stack.dup 'a dict.get succ succ 'a dict.set)\r\n (stack.dup 'b dict.get succ 'b dict.set)\r\n ) tap\r\n \r\n Returns {3 :a 3 :b 3 :c}.", "kind": "symbol", "module": "global", "name": "tap",@@ -2570,7 +2598,7 @@ "name": "datetime",
"signature": "int ==> str" }, "time.format": { - "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", "module": "time", "name": "format",@@ -2661,7 +2689,7 @@ "name": "to-semver",
"signature": "dict ==> str" }, "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", "module": "global", "name": "to-yaml",@@ -2675,7 +2703,7 @@ "name": "tokenize",
"signature": "str ==> quot" }, "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 (stack.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 (stack.pop)\r\n (format-error puts)\r\n (0)\r\n ) try", "kind": "symbol", "module": "global", "name": "try",@@ -2702,8 +2730,15 @@ "module": "global",
"name": "typealias", "signature": "'sym1 'sym2 ==> " }, + "typeclass": { + "description": "Symbol used to define a typeclass when using the operator symbol.", + "kind": "symbol", + "module": "global", + "name": "typeclass", + "signature": " ==> " + }, "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", "module": "global", "name": "union",@@ -2752,7 +2787,7 @@ "name": "when",
"signature": "quot1 quot2 ==> a*" }, "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", "module": "global", "name": "while",@@ -2794,7 +2829,7 @@ "name": "entity",
"signature": "'sym ==> dict:xml-entity" }, "xml.entity2utf8": { - "description": "Returns the UTF-8 symbol corresponding to the specified XML entity. \n \n \n Example\n \n The following program prints p to the screen:\n \n \">\" xml.entity xml.entity2utf8 puts!", + "description": "Returns the UTF-8 symbol corresponding to the specified XML entity. \r\n \r\n \r\n Example\r\n \r\n The following program prints p to the screen:\r\n \r\n \">\" xml.entity xml.entity2utf8 puts!", "kind": "symbol", "module": "xml", "name": "entity2utf8",@@ -2815,21 +2850,21 @@ "name": "from-html",
"signature": "'sym ==> xml-node" }, "xml.from-xml": { - "description": "Returns an xml-node representing an XML string (element or fragment).\n \n \n Example\n \n The following program:\n\n \"<a href='https://min-lang.org'min web site</a\" from-xml \n returns the following:\n \n {\n {\"https://min-lang.org\" :href} :attributes\n ({\"min web site\" :text}) :children\n \"a\" :tag\n ;xml-element\n }", + "description": "Returns an xml-node representing an XML string (element or fragment).\r\n \r\n \r\n Example\r\n \r\n The following program:\r\n\r\n \"<a href='https://min-lang.org'min web site</a\" from-xml \r\n returns the following:\r\n \r\n {\r\n {\"https://min-lang.org\" :href} :attributes\r\n ({\"min web site\" :text}) :children\r\n \"a\" :tag\r\n ;xml-element\r\n }", "kind": "symbol", "module": "xml", "name": "from-xml", "signature": "'sym ==> xml-node" }, "xml.query": { - "description": "Returns an dict:xml-element representing the first element matching CSS the selector 'sym.\n \n \n Example\n \n The following program:\n\n \"<ul\n <li class='test'first</li\n <li class='other'second</li\n <li class='test'third</li\n </ul\" \n xml.from-xml \".test\" xml.query\n Returns the following:\n\n {\n {\"test\" :class} :attributes \n ({\"first\" :text}) :children \n \"li\" :tag \n ;xml-element\n }", + "description": "Returns an dict:xml-element representing the first element matching CSS the selector 'sym.\r\n \r\n \r\n Example\r\n \r\n The following program:\r\n\r\n \"<ul\r\n <li class='test'first</li\r\n <li class='other'second</li\r\n <li class='test'third</li\r\n </ul\" \r\n xml.from-xml \".test\" xml.query\r\n Returns the following:\r\n\r\n {\r\n {\"test\" :class} :attributes \r\n ({\"first\" :text}) :children \r\n \"li\" :tag \r\n ;xml-element\r\n }", "kind": "symbol", "module": "xml", "name": "query", "signature": "dict:xml-element 'sym ==> dict:xml-element" }, "xml.query-all": { - "description": "Returns a list of dict:xml-element dictionaries representing all the elements matching CSS the selector 'sym.\n \n \n Example\n \n The following program:\n\n \"<ul\n <li class='test'first</li\n <li class='other'second</li\n <li class='test'third</li\n </ul\" \n xml.from-xml \".test\" xml.queryall\n Returns the following:\n\n ({\n {\"test\" :class} :attributes \n ({\"first\" :text}) :children \n \"li\" :tag \n ;xml-element\n }\n {\n {\"test\" :class} :attributes \n ({\"third\" :text}) :children \n \"li\" :tag \n ;xml-element\n })", + "description": "Returns a list of dict:xml-element dictionaries representing all the elements matching CSS the selector 'sym.\r\n \r\n \r\n Example\r\n \r\n The following program:\r\n\r\n \"<ul\r\n <li class='test'first</li\r\n <li class='other'second</li\r\n <li class='test'third</li\r\n </ul\" \r\n xml.from-xml \".test\" xml.queryall\r\n Returns the following:\r\n\r\n ({\r\n {\"test\" :class} :attributes \r\n ({\"first\" :text}) :children \r\n \"li\" :tag \r\n ;xml-element\r\n }\r\n {\r\n {\"test\" :class} :attributes \r\n ({\"third\" :text}) :children \r\n \"li\" :tag \r\n ;xml-element\r\n })", "kind": "symbol", "module": "xml", "name": "query-all",
@@ -1,7 +1,7 @@
" Vim syntax file " Language: min " Maintainer: Fabio Cevasco -" Last Change: 27 Oct 2024 +" Last Change: 28 Oct 2024 " Version: 0.46.0 if exists("b:current_syntax")@@ -11,7 +11,7 @@
setl iskeyword=@,36-39,+,-,*,.,/,:,~,!,48-57,60-65,94-95,192-255 setl iskeyword+=^ -syntax keyword minDefaultSymbol != $ % && ' * + - -> -inf / : :: < <= =% =-= == ==> => > >< >= >> ? @ ^ all? and any? append apply apply-interpolate args avg base base? bind bitand bitclear bitflip bitnot bitor bitparity bitset bitxor boolean boolean? capitalize case chr compiled? concat crypto decode-url define define-sigil defined-sigil? defined-symbol? delete-sigil delete-symbol dequote dev dev? dict dictionary? difference div drop encode-url escape eval even? exit expect expect-all expect-any expect-empty-stack filter find first flatten float float? foreach format-error from-bin from-dec from-hex from-json from-oct from-semver from-yaml fs get get-env get-raw gets global harvest help http if import in? indent indexof inf infix-dequote insert integer integer? interpolate intersection io join lambda lambda-bind last length line-info linrec load load-symbol loglevel loglevel? lowercase map map-reduce match? math med mod nan net not null? number? odd? one? operator opts or ord parent-scope parse parse-url partition pred prefix prefix-dequote prepend print product prompt publish put-env puts quit quotation? quote quote-map quotecmd quoted-symbol? quotesym raise random randomize range raw-args reduce reject remove remove-symbol repeat replace replace-apply require rest return reverse 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? set set-sym shl shorten shr sigil-help sigils size slice sort source split stack store string string? stringlike? strip substr succ suffix sum symbol-help symbols symmetric-difference sys take tap time times titleize to-bin to-dec to-hex to-json to-oct to-semver to-yaml tokenize try type type? typealias typealias:xml-node union unless unseal-sigil unseal-symbol uppercase version when while with xml xor ~ +syntax keyword minDefaultSymbol != $ % && ' * + - -> -inf / : :: < <= =% =-= == ==> => > >< >= >> ? @ ^ all? and any? append apply apply-interpolate args avg base base? bind bitand bitclear bitflip bitnot bitor bitparity bitset bitxor boolean boolean? capitalize case chr compiled? concat constructor crypto decode-url define define-sigil defined-sigil? defined-symbol? delete-sigil delete-symbol dequote dev dev? dict dictionary? difference div drop encode-url escape eval even? exit expect expect-all expect-any expect-empty-stack filter find first flatten float float? foreach format-error from-bin from-dec from-hex from-json from-oct from-semver from-yaml fs get get-env get-raw gets global harvest help http if import in? indent indexof inf infix-dequote insert integer integer? interpolate intersection io join lambda lambda-bind last length line-info linrec load load-symbol loglevel loglevel? lowercase map map-reduce match? math med mod nan net not null? number? odd? one? operator opts or ord parent-scope parse parse-url partition pred prefix prefix-dequote prepend print product prompt publish put-env puts quit quotation? quote quote-map quotecmd quoted-symbol? quotesym raise random randomize range raw-args reduce reject remove remove-symbol repeat replace replace-apply require rest return reverse 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? set set-sym shl shorten shr sigil sigil-help sigils size slice sort source split stack store string string? stringlike? strip substr succ suffix sum symbol symbol-help symbols symmetric-difference sys take tap time times titleize to-bin to-dec to-hex to-json to-oct to-semver to-yaml tokenize try type type? typealias typealias:xml-node typeclass union unless unseal-sigil unseal-symbol uppercase version when while with xml xor ~ syntax match minDefaultSymbol ;||; syntax keyword minCommentTodo TODO FIXME XXX TBD contained
@@ -111,34 +111,34 @@ stdout.write(s)
else: stdout.styledWrite(color, s) -proc printSymbol(s: string) = - let pS = processSymbolValue(s) +proc printSymbol(i: In, s: string) = + let pS = i.processSymbolValue(s) if pS.len == 0: p(s, fgCyan) else: for part in pS.items: if part["type"].getStr == "tkDict": p(part["value"].getStr, fgBlue) + elif part["type"].getStr == "tkGlobalSymbol": + p(part["value"].getStr, fgMagenta) elif ["tkDot", "tkAutopop", "tkSystemSigil"].contains part[ "type"].getStr: p(part["value"].getStr, fgRed) else: p(part["value"].getStr, fgCyan) -proc pv(item: MinValue) = +proc pv(i:In, item: MinValue) = case item.kind - of minNull, minBool: + of minNull, minBool, minFloat, minInt: p($item, fgGreen) of minSymbol: - printSymbol($item) + i.printSymbol($item) of minString: p($item, fgYellow) - of minFloat, minInt: - p($item, fgMagenta) of minQuotation: p("( ", fgRed) for val in item.qVal: - pv(val); stdout.write(" ") + i.pv(val); stdout.write(" ") p(")", fgRed) of minCommand: p("[ ", fgRed)@@ -152,7 +152,7 @@ if val.val.kind == minProcOp:
v = "<native>".newSym else: v = val.val.val - pv(v); p(" :" & $val.key & " ", fgCyan) + i.pv(v); p(" :" & $val.key & " ", fgCyan) p("}", fgRed) proc printResult(i: In, res: MinValue) =@@ -163,7 +163,7 @@ let n = $i.stack.len
if res.isQuotation and res.qVal.len > 1: p(" (\n", fgRed) for item in res.qVal: - p(" "); pv(item); stdout.write("\n") + p(" "); i.pv(item); stdout.write("\n") stdout.write(" ".repeat(n.len)); p(")\n", fgRed) elif res.isCommand: p(" [", fgRed); p(res.cmdVal, fgYellow); p("]\n")@@ -175,14 +175,14 @@ if item.val.kind == minProcOp:
v = "<native>".newSym else: v = item.val.val - p(" "); pv(v); p(" :" & $item.key & "\n", fgCyan) + p(" "); i.pv(v); p(" :" & $item.key & "\n", fgCyan) if res.objType == "": stdout.write " ".repeat(n.len); p("}\n", fgRed) else: stdout.write " ".repeat(n.len); p(" ;" & res.objType & "\n", fgBlue) stdout.write " ".repeat(n.len); p("}\n", fgRed) else: - stdout.write " "; pv(i.stack[i.stack.len - 1]); stdout.write("\n") + stdout.write " "; i.pv(i.stack[i.stack.len - 1]); stdout.write("\n") proc minSimpleRepl*(i: var MinInterpreter) = i.stdLib()
@@ -409,10 +409,10 @@ raiseInvalid("Two quotations or two strings are required on the stack")
const SYSTEM_SIGILS* = @[':', '\'', '?', '~', '@', '^'] -proc processSymbolValue*(v: string): JsonNode = +proc processSymbolValue*(i: In, v: string): JsonNode = result = newJArray() var sym = v - if SYSTEM_SIGILS.contains(v[0]): + if SYSTEM_SIGILS.contains(v[0]) and v != "::": sym = v[1..^1] var sigil = newJObject() sigil["type"] = %"tkSystemSigil"@@ -426,6 +426,8 @@ var symbol = newJObject()
var typ = "tkDict" if syms.len == 1 or count >= syms.len-1: typ = "tkSymbol" + if i.scope.getSymbol("global").mdl.scope.symbols.hasKey(s): + typ = "tkGlobalSymbol" symbol["type"] = %typ symbol["value"] = %sym result.add symbol
@@ -1202,7 +1202,7 @@ var dict = newDict(i.scope)
i.dset(dict, "type", newVal($t)) i.dset(dict, "value", p.a.processTokenValue(t).newVal) if t == tkSymbol: - let parsedValue = processSymbolValue(p.a) + let parsedValue = i.processSymbolValue(p.a) if parsedValue.len > 0: i.dset(dict, "parsedValue", i.fromJson parsedValue) q.add dict@@ -1212,7 +1212,7 @@ var dict = newDict(i.scope)
i.dset(dict, "type", newVal($t)) i.dset(dict, "value", p.a.processTokenValue(t).newVal) if t == tkSymbol: - let parsedValue = processSymbolValue(p.a) + let parsedValue = i.processSymbolValue(p.a) if parsedValue.len > 0: i.dset(dict, "parsedValue", i.fromJson parsedValue) q.add dict@@ -2509,6 +2509,18 @@ def.symbol("==>") do (i: In):
discard # used within operator defs def.symbol("return") do (i: In): + discard # used within operator defs + + def.symbol("symbol") do (i: In): + discard # used within operator defs + + def.symbol("sigil") do (i: In): + discard # used within operator defs + + def.symbol("constructor") do (i: In): + discard # used within operator defs + + def.symbol("typeclass") do (i: In): discard # used within operator defs def.symbol(">>") do (i: In):
@@ -8,7 +8,9 @@
### Fixes and Improvements * Implemented `define-sigil` (was documented but not actually implemented). +* Reviewed documentation making sure that documented operators match with implementation. * The `help` symbol now correctly displays help for namespaced symbols. * Enhanced the `tokenizer` symbol to provide additional information for symbols. -* Enhanced min shell highlighting to support dot notation, sigils, autopop. +* Enhanced min shell highlighting to support dot notation, sigils, autopop, global symbols. +* Enhanced Vim syntax file (`min.vim`) to support latest constructs.
@@ -380,12 +380,12 @@ color: #fb820a;
} .min-tkDot { - color: #a97bff + color: #c60d10 } .min-tkInt, .min-tkFloat { - color: #f381f7; + color: #22f991; } .min-tkString {@@ -402,6 +402,10 @@ }
.min-tkSymbol { color: #7ddbfe; +} + +.min-tkGlobalSymbol { + color: #ff9bf4; } .min-tkNull,
@@ -198,6 +198,10 @@
{#op||concat||{{q1}} {{q2}}||{{q3}}|| Concatenates {{q1}} with {{q2}}. #} +{#op||constructor||{{none}}||{{none}}|| +Symbol used to define a constructor when using the operator symbol. +#} + {#op||decode-url||{{sl}}||{{s}}|| URL-decodes {{sl}}, deconding all URL-encoded characters.#}@@ -606,7 +610,7 @@ > 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.
> > {{q}} is a quotation containing: > -> * A symbol identifying the type of operator to define (`symbol`, `sigil`, or `typeclass`). +> * A symbol identifying the type of operator to define (`symbol`, `sigil`, `constructor` or `typeclass`). > * A symbol identifying the name of the operator. > * A quotation defining the signature of the operator, containing input and output values identified by their type and a capturing symbol, separated by the `==>` symbol. > * A quotation identifying the body of the operator.@@ -700,7 +704,7 @@
{#op||prompt||{{none}}||{{s}}|| > This symbol is used to configure the prompt of the min shell. By default, it is set to the following quotation: > -> ("[$1]$$ " (sys.pwd) => %) +> ("[$1]$$ " (sys.pwd) => %) #} {#op||publish||{{sl}} {{d}}||{{none}}|| > Publishes symbol {{sl}} to the scope of {{d}}.@@ -932,6 +936,10 @@
{#op||shr||{{i1}} {{i2}}||{{i3}}|| Computes the *shift right* operation of {{i1}} and {{i2}}.#} +{#op||sigil||{{none}}||{{none}}|| +Symbol used to define a sigil when using the operator symbol. +#} + {#op||sigil-help||{{sl}}||{{help}}|{{null}}|| Returns the help dictionary for the sigil {{sl}}, if available, {{null}} otherwise. #}@@ -991,6 +999,10 @@ Appends {{sl2}} to {{sl1}}.#}
{#op||sum||{{q}}||{{i}}|| Returns the sum of all items of {{q}}. {{q}} is a quotation of integers. #} + +{#op||symbol||{{none}}||{{none}}|| +Symbol used to define a symbol when using the operator symbol. +#} {#op||symbol-help||{{sl}}||{{help}}|{{null}}|| Returns the help dictionary for the symbol {{sl}}, if available, {{null}} otherwise. #}@@ -1095,6 +1107,10 @@ Returns {{t}} if the data type of {{any}} satisfies the specified type expression {{sl}}, {{f}} otherwise. #}
{#op||typealias||{{sl1}} {{sl2}}||{{none}}|| Creates a type alias {{sl1}} for type expression {{sl2}}.#} + +{#op||typeclass||{{none}}||{{none}}|| +Symbol used to define a typeclass when using the operator symbol. +#} {#op||union||{{q1}} {{q2}}||{{q3}}|| > Calculates the union {{q3}} of {{q1}} and {{q2}}.