all repos — min @ d0d644faeeecdd1812927dbd61b3061ab3e81187

A small but practical concatenative programming language.

Merge branch 'next'
h3rald h3rald@h3rald.com
Tue, 18 Jun 2024 12:26:23 +0000
commit

d0d644faeeecdd1812927dbd61b3061ab3e81187

parent

1f74abac4eba4f01a474b0747c8e01135175e7be

M help.jsonhelp.json

@@ -1,2494 +1,2888 @@

{ - "operators": { - "!": { - "description": "See system", - "kind": "symbol", - "name": "!" + "sigils": { + "$": { + "description": "See get-env", + "kind": "sigil", + "module": "global", + "name": "$" + }, + "'": { + "description": "See quotesym", + "kind": "sigil", + "module": "global", + "name": "'" + }, + ":": { + "description": "See define", + "kind": "sigil", + "module": "global", + "name": ":" + }, + "?": { + "description": "See help", + "kind": "sigil", + "module": "global", + "name": "?" + }, + "@": { + "description": "See bind", + "kind": "sigil", + "module": "global", + "name": "@" + }, + "^": { + "description": "See lambda", + "kind": "sigil", + "module": "global", + "name": "^" }, + "~": { + "description": "See lambda-bind", + "kind": "sigil", + "module": "global", + "name": "~" + } + }, + "symbols": { "!=": { "description": "Returns true if a1 is not equal to a2, false otherwise.", "kind": "symbol", + "module": "logic", "name": "!=", "signature": "a1 a2 ==> bool" }, "$": { "description": "See get-env", "kind": "symbol", + "module": "global", "name": "$" }, "%": { "description": "See interpolate", "kind": "symbol", + "module": "str", "name": "%" }, - "&": { - "description": "See run", - "kind": "symbol", - "name": "&" - }, "&&": { "description": "See expect-all", "kind": "symbol", + "module": "logic", "name": "&&" }, "&vert;&vert;": { "description": "See expect-any", "kind": "symbol", + "module": "logic", "name": "&vert;&vert;" }, "'": { "description": "See quotesym", "kind": "symbol", + "module": "global", "name": "'" }, "*": { "description": "Multiplies num1 by num2.", "kind": "symbol", + "module": "num", "name": "*", "signature": "num1 num2 ==> num3" }, "+": { "description": "Sums num1 and num2.", "kind": "symbol", + "module": "num", "name": "+", "signature": "num1 num2 ==> num3" }, "-": { - "description": "Subtracts num2 from num1.", + "description": "See dequote", "kind": "symbol", - "name": "-", - "signature": "num1 num2 ==> num3" + "module": "global", + "name": "-" }, "-inf": { "description": "Returns negative infinity.", "kind": "symbol", + "module": "num", "name": "-inf", "signature": " ==> num" }, - ".": { - "description": "Returns the full path to the current directory.", - "kind": "symbol", - "name": ".", - "signature": " ==> str" - }, - "..": { - "description": "Returns the full path to the parent directory.", - "kind": "symbol", - "name": "..", - "signature": " ==> str" - }, "/": { "description": "Divides num1 by num2.", "kind": "symbol", + "module": "num", "name": "/", "signature": "num1 num2 ==> num3" }, ":": { "description": "See define", "kind": "symbol", + "module": "global", "name": ":" }, "::": { "description": "See operator", "kind": "symbol", + "module": "global", "name": "::" }, "<": { - "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.", + "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.", "kind": "symbol", + "module": "logic", "name": "<", "signature": "a1 a2 ==> bool" }, "<=": { - "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.", + "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.", "kind": "symbol", + "module": "logic", "name": "<=", "signature": "a1 a2 ==> bool" }, "=%": { "description": "See apply-interpolate", "kind": "symbol", + "module": "str", "name": "=%" }, "=-=": { "description": "See expect-empty-stack", "kind": "symbol", + "module": "global", "name": "=-=" }, "==": { "description": "Returns true if a1 is equal to a2, false otherwise.", "kind": "symbol", + "module": "logic", "name": "==", "signature": "a1 a2 ==> bool" }, "==>": { "description": "Symbol used to separate input and output values in operator signatures.", "kind": "symbol", + "module": "global", "name": "==>", "signature": " ==> " }, "=>": { "description": "See apply", "kind": "symbol", + "module": "global", "name": "=>" }, ">": { - "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.", + "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.", "kind": "symbol", + "module": "logic", "name": ">", "signature": "a1 a2 ==> bool" }, "><": { "description": "See infix-dequote", "kind": "symbol", + "module": "global", "name": "><" }, ">=": { - "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.", + "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.", "kind": "symbol", + "module": "logic", "name": ">=", "signature": "a1 a2 ==> bool" }, ">>": { "description": "See prefix-dequote", "kind": "symbol", + "module": "global", "name": ">>" }, "?": { "description": "See help", "kind": "symbol", + "module": "global", "name": "?" }, "@": { "description": "See bind", "kind": "symbol", + "module": "global", "name": "@" }, "^": { "description": "See lambda", "kind": "symbol", + "module": "global", "name": "^" }, "abs": { "description": "Calculates tbe absolute value of num1.", "kind": "symbol", + "module": "math", "name": "abs", "signature": "num1 ==> num2" }, "absolute-path": { "description": "Returns the absolute path to 'sym.", "kind": "symbol", + "module": "fs", "name": "absolute-path", "signature": "'sym ==> str" }, "absolute-path?": { "description": "Returns true if 'sym is an absolute path.", "kind": "symbol", + "module": "fs", "name": "absolute-path?", "signature": "'sym ==> bool" }, "accept": { "description": "Makes dict:socket2 (server) accept a connection from dict:socket1 (client). Returns the client socket dict:socket1 from which it will be possible to receive data from.", "kind": "symbol", + "module": "net", "name": "accept", "signature": "dict:socket1 dict:socket2 ==> dict:socket1" }, "acos": { "description": "Calculates the arc cosine of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "acos", "signature": "num1 ==> num2" }, "admin?": { "description": "Returns true if the program is being run with administrative privileges.", "kind": "symbol", + "module": "sys", "name": "admin?", "signature": " ==> bool" }, "aes": { "description": "Encrypts or decrypts 'sym1 using the Advanced Encryption Standard (AES) in CTR mode, using 'sym2 as password.", "kind": "symbol", + "module": "crypto", "name": "aes", "signature": "'sym1 'sym2 ==> str" }, "all?": { "description": "Applies predicate quot2 to each element of quot1 and returns true if all elements of quot1 satisfy predicate quot2, false otherwise.", "kind": "symbol", + "module": "seq", "name": "all?", "signature": "quot1 quot2 ==> bool" }, "and": { "description": "Returns true if bool1 is equal to bool2, false otherwise.", "kind": "symbol", + "module": "logic", "name": "and", "signature": "bool1 bool2 ==> bool3" }, "any?": { "description": "Applies predicate quot2 to each element of quot1 and returns true if at least one element of quot1 satisfies predicate quot2, false otherwise.", "kind": "symbol", + "module": "seq", "name": "any?", "signature": "quot1 quot2 ==> bool" }, "append": { "description": "Returns a new quotation containing the contents of quot with a appended.", "kind": "symbol", + "module": "seq", "name": "append", "signature": "a quot ==> (a* a)" }, "apply": { "description": "Returns a new quotation obtained by evaluating each element of quot in a separate stack.", "kind": "symbol", + "module": "global", "name": "apply", "signature": "quot ==> (a*)" }, "apply-interpolate": { "description": "The same as pushing apply and then interpolate on the stack.", "kind": "symbol", + "module": "str", "name": "apply-interpolate", "signature": "str quot ==> str" }, "args": { "description": "Returns a list of all arguments passed to the current program.", "kind": "symbol", + "module": "global", "name": "args", "signature": " ==> quot" }, "asin": { "description": "Calculates the arc sine of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "asin", "signature": "num1 ==> num2" }, "ask": { "description": "Prints str1 (prompt), reads a line from STDIN and places it on top of the stack as a string.", "kind": "symbol", + "module": "io", "name": "ask", "signature": "str1 ==> str2" }, "atan": { "description": "Calculates the arc tangent of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "atan", "signature": "num1 ==> num2" }, "atime": { "description": "Returns a timestamp corresponding to the time that file/directory 'sym was last accessed.", "kind": "symbol", + "module": "fs", "name": "atime", "signature": "'sym ==> flt" }, "avg": { "description": "Returns the average of the items of quot.", "kind": "symbol", + "module": "num", "name": "avg", "signature": "quot ==> num" }, "base": { "description": "Sets the numeric base used to represent integers.", "kind": "symbol", + "module": "num", "name": "base", "signature": "\"dec\"|\"hex\"|\"oct\"|\"bin\" ==> " }, "base?": { "description": "Returns the numeric base currently used to represent integers (default: [&quot;dec&quot;](class:kwd)).", "kind": "symbol", + "module": "num", "name": "base?", "signature": " ==> \"dec\"|\"hex\"|\"oct\"|\"bin\"" }, "bind": { "description": "Binds the specified value (auto-quoted) to an existing symbol 'sym.", "kind": "symbol", + "module": "global", "name": "bind", "signature": "a 'sym ==> " }, "bitand": { "description": "Computes the bitwise *and* of integer int1 and int2.", "kind": "symbol", + "module": "num", "name": "bitand", "signature": "int1 int2 ==> int3" }, "bitclear": { "description": "Sets the bytes specified via their position in int1 through quot to 0.", "kind": "symbol", + "module": "num", "name": "bitclear", "signature": "int1 quot ==> int2" }, "bitflip": { "description": "Flips the bytes specified via their position in int1 through quot.", "kind": "symbol", + "module": "num", "name": "bitflip", "signature": "int1 quot ==> int2" }, "bitnot": { "description": "Computes the bitwise *complement* of int1.", "kind": "symbol", + "module": "num", "name": "bitnot", "signature": "int1 ==> int2" }, "bitor": { "description": "Computes the bitwise *or* of integers int1 and int2.", "kind": "symbol", + "module": "num", "name": "bitor", "signature": "int1 int2 ==> int3" }, "bitparity": { "description": "Calculate the bit parity in int1. If the number of 1-bits is odd, the parity is 1, otherwise 0.", "kind": "symbol", + "module": "num", "name": "bitparity", "signature": "int1 ==> int2" }, "bitset": { "description": "Sets the bytes specified via their position in int1 through quot to 0.", "kind": "symbol", + "module": "num", "name": "bitset", "signature": "int1 quot ==> int2" }, "bitxor": { "description": "Computes the bitwise *xor* of integers int1 and int2.", "kind": "symbol", + "module": "num", "name": "bitxor", "signature": "int1 int2 ==> int3" }, "bool": { - "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.", + "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.", "kind": "symbol", + "module": "global", "name": "bool", "signature": "a ==> bool" }, "boolean?": { "description": "Returns true if a is a boolean, false otherwise.", "kind": "symbol", + "module": "logic", "name": "boolean?", "signature": "a ==> bool" }, "capitalize": { "description": "Returns a copy of 'sym with the first character capitalized.", "kind": "symbol", + "module": "str", "name": "capitalize", "signature": "'sym ==> str" }, "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", + "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", "kind": "symbol", + "module": "global", "name": "case", "signature": "((quot1 quot2)*) ==> a*" }, "cd": { "description": "Change the current directory to 'sym.", "kind": "symbol", + "module": "sys", "name": "cd", "signature": "'sym ==> " }, "ceil": { "description": "Returns the smallest integer int that is not smaller than num.", "kind": "symbol", + "module": "math", "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.\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", + "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", "kind": "symbol", + "module": "sys", "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.\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.", + "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.", "kind": "symbol", + "module": "io", "name": "choose", "signature": "((str1 quot1)+) str2 ==> a*" }, "chr": { "description": "Returns the single character str obtained by interpreting int as an ASCII code.", "kind": "symbol", + "module": "str", "name": "chr", "signature": "int ==> str" }, "clear": { "description": "Clears the screen.", "kind": "symbol", + "module": "io", "name": "clear", "signature": " ==> " }, "clear-stack": { "description": "Empties the stack.", "kind": "symbol", + "module": "stack", "name": "clear-stack", "signature": "a ==> " }, "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 /", + "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 /", "kind": "symbol", + "module": "stack", "name": "cleave", "signature": "a1 (quot*) ==> a*" }, "close": { "description": "Closes a previously-opened socket.", "kind": "symbol", + "module": "net", "name": "close", "signature": "dict:socket ==> " }, + "color": { + "description": "Enables or disabled color output in terminal (enabled by default).", + "kind": "symbol", + "module": "io", + "name": "color", + "signature": "bool ==> " + }, "column-print": { "description": "Prints all elements of quot to STDOUT, in int columns.", "kind": "symbol", + "module": "io", "name": "column-print", "signature": "quot int ==> a" }, "compiled?": { "description": "Returns true if the current program has been compiled.", "kind": "symbol", + "module": "global", "name": "compiled?", "signature": " ==> bool" }, "concat": { "description": "Concatenates quot1 with quot2.", "kind": "symbol", + "module": "seq", "name": "concat", "signature": "quot1 quot2 ==> quot3" }, "confirm": { - "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.", + "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.", "kind": "symbol", + "module": "io", "name": "confirm", "signature": "str ==> bool" }, "connect": { - "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", + "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", "kind": "symbol", + "module": "net", "name": "connect", "signature": "dict:socket str int ==> dict:socket" }, "cons": { "description": "Prepends a1 to the quotation on top of the stack.", "kind": "symbol", + "module": "stack", "name": "cons", "signature": "a1 (a*) ==> (a1 a*)" }, "cos": { "description": "Calculates the cosine of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "cos", "signature": "num1 ==> num2" }, "cosh": { "description": "Calculates the hyperbolic cosine of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "cosh", "signature": "num1 ==> num2" }, "cp": { "description": "Copies the file or directory 'sym1 to 'sym2.", "kind": "symbol", + "module": "sys", "name": "cp", "signature": "'sym1 'sym2 ==> " }, "cpu": { "description": "Returns the host CPU. It can be one of the following strings i386, alpha, powerpc, powerpc64, powerpc64el, sparc, amd64, mips, mipsel, arm, arm64.", "kind": "symbol", + "module": "sys", "name": "cpu", "signature": " ==> str" }, "ctime": { "description": "Returns a timestamp corresponding to the time that file/directory 'sym was created.", "kind": "symbol", + "module": "fs", "name": "ctime", "signature": "'sym ==> flt" }, "d2r": { "description": "Converts num1 from degrees to radians.", "kind": "symbol", + "module": "math", "name": "d2r", "signature": "num1 ==> num2" }, "datetime": { "description": "Returns an ISO 8601 string representing the combined date and time in UTC of timestamp int.", "kind": "symbol", + "module": "time", "name": "datetime", "signature": "int ==> str" }, "ddel": { "description": "Removes 'sym from dict1 and returns dict1.", "kind": "symbol", + "module": "dict", "name": "ddel", "signature": "dict 'sym ==> dict" }, "ddup": { "description": "Returns a copy of dict1.", "kind": "symbol", + "module": "dict", "name": "ddup", "signature": "dict1 ==> dict2" }, "debug": { "description": "Prints a and a new line to STDOUT, if logging level is set to [debug](class:kwd) or lower.", "kind": "symbol", + "module": "io", "name": "debug", "signature": "a ==> a" }, "decode": { "description": "Decodes the Base64-encoded string 'sym.", "kind": "symbol", + "module": "crypto", "name": "decode", "signature": "'sym ==> str" }, "define": { "description": "Defines a new symbol 'sym, containing the specified value.", "kind": "symbol", + "module": "global", "name": "define", "signature": "a 'sym ==> " }, "define-sigil": { "description": "Defines a new sigil 'sym, containing the specified value (auto-quoted if not already a quotation).", "kind": "symbol", + "module": "global", "name": "define-sigil", "signature": "a 'sym ==> " }, "defined-sigil?": { "description": "Returns true if the symbol 'sym is defined, false otherwise.", "kind": "symbol", + "module": "global", "name": "defined-sigil?", "signature": "'sym ==> bool" }, "defined-symbol?": { "description": "Returns true if the symbol 'sym is defined, false otherwise.", "kind": "symbol", + "module": "global", "name": "defined-symbol?", "signature": "'sym ==> bool" }, "delete-sigil": { "description": "Deletes the specified user-defined sigil 'sym.", "kind": "symbol", + "module": "global", "name": "delete-sigil", "signature": "'sym ==> " }, "dequote": { - "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.", + "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.", "kind": "symbol", + "module": "global", "name": "dequote", "signature": "quot ==> a*" }, "dev": { "description": "Toggles development mode.", "kind": "symbol", + "module": "global", "name": "dev", "signature": " ==> " }, "dev?": { "description": "Returns true if the current program is being executed in development mode.", "kind": "symbol", + "module": "global", "name": "dev?", "signature": " ==> bool" }, "dget": { "description": "Returns the value of key 'sym from dictionary dict.", "kind": "symbol", + "module": "dict", "name": "dget", "signature": "dict 'sym ==> a" }, "dget-raw": { "description": "Returns the value of key 'sym from dictionary dict, wrapped in a dict:rawval.", "kind": "symbol", + "module": "dict", "name": "dget-raw", "signature": "dict 'sym ==> dict:rawval" }, "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?", + "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?", "kind": "symbol", + "module": "dict", "name": "dhas?", "signature": "dict 'sym ==> bool" }, "dictionary?": { "description": "Returns true if a is a dictionary, false otherwise.", "kind": "symbol", + "module": "logic", "name": "dictionary?", "signature": "a ==> bool" }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "difference", "signature": "quot1 quot2 ==> quot3" }, "dip": { "description": "Removes the first and second element from the stack, dequotes the first element, and restores the second element.", "kind": "symbol", + "module": "stack", "name": "dip", "signature": "a1 (a2) ==> a* a1" }, "dir?": { "description": "Returns true if the specified path 'sym exists and is a directory.", "kind": "symbol", + "module": "fs", "name": "dir?", "signature": "'sym ==> bool" }, "dirname": { "description": "Returns the path of the directory containing path 'sym.", "kind": "symbol", + "module": "fs", "name": "dirname", "signature": "'sym ==> str" }, "div": { "description": "Divides int1 by int2 (integer division).", "kind": "symbol", + "module": "num", "name": "div", "signature": "int1 int2 ==> int3" }, "dkeys": { "description": "Returns a quotation containing all the keys of dictionary dict.", "kind": "symbol", + "module": "dict", "name": "dkeys", "signature": "dict ==> (str*)" }, "download": { "description": "Downloads the contents of URL str1 to the local file str2.", "kind": "symbol", + "module": "http", "name": "download", "signature": "str1 str2 ==> " }, "dpairs": { - "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} dpairs", + "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} dpairs", "kind": "symbol", + "module": "dict", "name": "dpairs", "signature": "dict ==> (a*)" }, "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", + "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", "kind": "symbol", + "module": "dict", "name": "dpick", "signature": "dict1 quot ==> dict2" }, "drop": { "description": "Returns a quotation quot2 containing the remaining elements after the first _n_ values of the input quotation quot1, or an empty quotation if int is greater than the length of quot1.", "kind": "symbol", + "module": "seq", "name": "drop", "signature": "quot1 int ==> quot2" }, "dsdelete": { "description": "Removes an item from the datastore dict:datastore. The item is uniquely identified by 'sym, which contains the collection containing the item and the item id, separated by a forward slash (/). Puts the reference to the modified datastore back on tbe stack.", "kind": "symbol", + "module": "dstore", "name": "dsdelete", "signature": "dict:datastore 'sym ==> dict:datastore" }, "dset": { "description": "Sets the value of the 'sym of dict1 to a, and returns the modified dictionary dict.", "kind": "symbol", + "module": "dict", "name": "dset", "signature": "dict a 'sym ==> dict" }, "dset-sym": { "description": "Sets the value of the 'sym of dict1 to 'sym (treating it as a symbol), and returns the modified dictionary dict.", "kind": "symbol", + "module": "dict", "name": "dset-sym", "signature": "dict 'sym 'sym ==> dict" }, "dsget": { "description": "Retrieves item dict from datastore dict:datastore. dict is retrieved by specifying 'sym, which contains the collection containing the item and the item id, separated by a forward slash (/).", "kind": "symbol", + "module": "dstore", "name": "dsget", "signature": "dict:datastore 'sym ==> dict" }, "dsinit": { "description": "Initializes a bew datastore by creating the 'sym JSON file. Puts the datastore instance on the stack.", "kind": "symbol", + "module": "dstore", "name": "dsinit", "signature": "'sym ==> dict:datastore" }, "dspost": { "description": "Adds the dictionary dict to the datastore dict:datastore inside collection 'sym, generating and adding a unique **id** field to dict. If the collection 'sym does not exist it is created. Puts the reference to the modified datastore back on tbe stack.", "kind": "symbol", + "module": "dstore", "name": "dspost", "signature": "dict:datastore 'sym dict ==> dict:datastore" }, "dsput": { "description": "Adds the dictionary dict to the datastore dict:datastore. 'sym contains the collection where dict will be placed and the id of dict, separated by a forward slash (/). If the collection 'sym does not exist it is created. Puts the reference to the modified datastore back on tbe stack.", "kind": "symbol", + "module": "dstore", "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.\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", + "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", "kind": "symbol", + "module": "dstore", "name": "dsquery", "signature": "dict:datastore 'sym quot ==> (dict*)" }, "dsread": { "description": "Reads the previously-created datastore from the file 'sym and puts the resulting datastore instance on the stack.", "kind": "symbol", + "module": "dstore", "name": "dsread", "signature": "'sym ==> dict:datastore" }, "dswrite": { "description": "Writes the contents of the datastore dict:datastore to the filesystem.", "kind": "symbol", + "module": "dstore", "name": "dswrite", "signature": "dict:datastore ==> dict:datastore" }, "dtype": { "description": "Returns a string set to the type of dict (empty if the dictionary has no type).", "kind": "symbol", + "module": "dict", "name": "dtype", "signature": "dict ==> str" }, "dup": { "description": "Duplicates the first element on the stack.", "kind": "symbol", + "module": "stack", "name": "dup", "signature": "a1 ==> a1 a1" }, "dvalues": { "description": "Returns a quotation containing all the values of dictionary dict.", "kind": "symbol", + "module": "dict", "name": "dvalues", "signature": "dict ==> (a*)" }, "e": { "description": "Returns the value of the _e_ constant (Euler's number).", "kind": "symbol", + "module": "math", "name": "e", "signature": " ==> num" }, "encode": { "description": "Base64-encodes 'sym.", "kind": "symbol", + "module": "crypto", "name": "encode", "signature": "'sym ==> str" }, "env?": { "description": "Returns true if environment variable 'sym exists, false otherwise.", "kind": "symbol", + "module": "sys", "name": "env?", "signature": "'sym ==> bool" }, "error": { "description": "Prints a and a new line to STDERR, if logging level is set to [error](class:kwd) or lower.", "kind": "symbol", + "module": "io", "name": "error", "signature": "a ==> a" }, "escape": { "description": "Returns a copy of 'sym with quotes and backslashes escaped with a backslash.", "kind": "symbol", + "module": "str", "name": "escape", "signature": "'sym ==> str" }, "eval": { "description": "Parses and interprets str.", "kind": "symbol", + "module": "global", "name": "eval", "signature": "str ==> a*" }, "even?": { "description": "Returns true if int is even, false otherwise.", "kind": "symbol", + "module": "num", "name": "even?", "signature": "int ==> bool" }, "exists?": { "description": "Returns true if the specified file or directory 'sym exists.", "kind": "symbol", + "module": "fs", "name": "exists?", "signature": "'sym ==> bool" }, "exit": { "description": "Exits the program or shell with int as return code.", "kind": "symbol", + "module": "global", "name": "exit", "signature": "int ==> " }, "expand-filename": { "description": "Returns the absolute path to the file name 'sym.", "kind": "symbol", + "module": "fs", "name": "expand-filename", "signature": "'sym ==> str" }, "expand-symlink": { "description": "Returns the absolute path to the symlink 'sym (an error is raised if 'sym is not a symlink).", "kind": "symbol", + "module": "fs", "name": "expand-symlink", "signature": "'sym ==> str" }, "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. \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) ==", + "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) ==", "kind": "symbol", + "module": "global", "name": "expect", "signature": "quot1 ==> quot2" }, "expect-all": { "description": "Assuming that quot is a quotation of quotations each evaluating to a boolean value, it pushes true on the stack if they all evaluate to true, false otherwise.", "kind": "symbol", + "module": "logic", "name": "expect-all", "signature": "quot ==> bool" }, "expect-any": { "description": "Assuming that quot is a quotation of quotations each evaluating to a boolean value, it pushes true on the stack if any evaluates to true, false otherwise.", "kind": "symbol", + "module": "logic", "name": "expect-any", "signature": "quot ==> bool" }, "expect-empty-stack": { "description": "Raises an error if the stack is not empty.", "kind": "symbol", + "module": "global", "name": "expect-empty-stack", "signature": " ==> " }, "fappend": { "description": "Appends str1 to the end of file str2.", "kind": "symbol", + "module": "io", "name": "fappend", "signature": "str1 str2 ==> " }, "fatal": { "description": "Prints a and a new line to STDERR, and exists the program with error code 100.", "kind": "symbol", + "module": "io", "name": "fatal", "signature": "a ==> a" }, "file?": { "description": "Returns true if the specified path 'sym exists and is a file.", "kind": "symbol", + "module": "fs", "name": "file?", "signature": "'sym ==> bool" }, "filename": { "description": "Returns the file name of path 'sym.", "kind": "symbol", + "module": "fs", "name": "filename", "signature": "'sym ==> str" }, "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", + "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", "kind": "symbol", + "module": "seq", "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.\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", + "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", "kind": "symbol", + "module": "seq", "name": "find", "signature": "quot1 quot2 ==> int" }, "first": { "description": "Returns the first element of quot.", "kind": "symbol", + "module": "seq", "name": "first", "signature": "quot ==> a" }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "flatten", "signature": "quot1 ==> quot2" }, "float": { - "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.", + "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.", "kind": "symbol", + "module": "global", "name": "float", "signature": "a ==> flt" }, "float?": { "description": "Returns true if a is a float, false otherwise.", "kind": "symbol", + "module": "logic", "name": "float?", "signature": "a ==> bool" }, "floor": { "description": "Returns the largest integer int that is not greater than num.", "kind": "symbol", + "module": "math", "name": "floor", "signature": "num ==> int" }, "foreach": { "description": "Applies the quotation quot2 to each element of quot1.", "kind": "symbol", + "module": "global", "name": "foreach", "signature": "quot1 quot2 ==> a*" }, "format-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\"", + "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\"", "kind": "symbol", + "module": "global", "name": "format-error", "signature": "dict:error ==> str" }, "fperms": { "description": "Returns the Unix permissions (expressed as a three-digit number) of file/directory 'sym.", "kind": "symbol", + "module": "fs", "name": "fperms", "signature": "'sym ==> int" }, "fread": { "description": "Reads the file str and puts its contents on the top of the stack as a string.", "kind": "symbol", + "module": "io", "name": "fread", "signature": "str ==> str" }, "from-bin": { "description": "Parses 'sym as a binary number.", "kind": "symbol", + "module": "str", "name": "from-bin", "signature": "'sym ==> int" }, "from-dec": { "description": "Parses 'sym as a decimal number.", "kind": "symbol", + "module": "str", "name": "from-dec", "signature": "'sym ==> int" }, "from-hex": { "description": "Parses 'sym as a hexadecimal number.", "kind": "symbol", + "module": "str", "name": "from-hex", "signature": "'sym ==> int" }, + "from-html": { + "description": "Returns an xml-node representing an HTML string (wrapped in a <document tag unless a valid HTML document is provided as input).", + "kind": "symbol", + "module": "xml", + "name": "from-html", + "signature": "'sym ==> xml-node" + }, "from-json": { "description": "Converts a JSON string into min data.", "kind": "symbol", + "module": "global", "name": "from-json", "signature": "str ==> a" }, "from-oct": { "description": "Parses 'sym as a octal number.", "kind": "symbol", + "module": "str", "name": "from-oct", "signature": "'sym ==> int" }, "from-semver": { - "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.", + "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.", "kind": "symbol", + "module": "str", "name": "from-semver", "signature": "str ==> dict" }, "from-xml": { - "description": "Returns an xml-node representing an XML string representing an 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 }", + "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 }", "kind": "symbol", + "module": "xml", "name": "from-xml", "signature": "'sym ==> xml-node" }, "from-yaml": { - "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.", + "description": "Converts a YAML string into min data.\n \n Note\n \n At present, only YAML objects containing string values are supported.", "kind": "symbol", + "module": "global", "name": "from-yaml", "signature": "str ==> a" }, "fsize": { "description": "Returns the size in bytes of file/directory 'sym.", "kind": "symbol", + "module": "fs", "name": "fsize", "signature": "'sym ==> int" }, "fstats": { - "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 }", + "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 }", "kind": "symbol", + "module": "fs", "name": "fstats", "signature": "'sym ==> dict" }, "ftype": { "description": "Returns the type of file/directory 'sym (\"file\" or \"dir\").", "kind": "symbol", + "module": "fs", "name": "ftype", "signature": "'sym ==> str" }, "fwrite": { "description": "Writes str1 to the file str2, erasing all its contents first.", "kind": "symbol", + "module": "io", "name": "fwrite", "signature": "str1 str2 ==> " }, "get": { "description": "Returns the _n^th_ element of quot (zero-based).", "kind": "symbol", + "module": "seq", "name": "get", "signature": "quot int ==> a" }, "get-content": { "description": "Retrieves the contents of URL str1 as str2.", "kind": "symbol", + "module": "http", "name": "get-content", "signature": "str1 ==> str2" }, "get-env": { "description": "Returns environment variable 'sym.", "kind": "symbol", + "module": "global", "name": "get-env", "signature": "'sym ==> str" }, "get-stack": { "description": "Puts a quotation containing the contents of the stack on the stack.", "kind": "symbol", + "module": "stack", "name": "get-stack", "signature": " ==> (a*)" }, "getchr": { "description": "Reads single character from STDIN without waiting for ENTER key and places its ASCII code on top of the stack.", "kind": "symbol", + "module": "io", "name": "getchr", "signature": " ==> int" }, "gets": { "description": "Reads a line from STDIN and places it on top of the stack as a string.", "kind": "symbol", + "module": "global", "name": "gets", "signature": " ==> str" }, "getstack": { "description": "See get-stack", "kind": "symbol", + "module": "stack", "name": "getstack" }, "hardlink": { "description": "Creates hardlink 'sym2 for file or directory 'sym1.", "kind": "symbol", + "module": "sys", "name": "hardlink", "signature": "'sym1 'sym2 ==> " }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "harvest", "signature": "quot1 ==> quot2" }, "help": { "description": "Prints the help text for 'sym, if available.", "kind": "symbol", + "module": "global", "name": "help", "signature": "'sym ==> " }, "hidden?": { "description": "Returns true if file/directory 'sym is hidden, false otherwise.", "kind": "symbol", + "module": "fs", "name": "hidden?", "signature": "'sym ==> bool" }, "id": { "description": "Does nothing.", "kind": "symbol", + "module": "stack", "name": "id", "signature": " ==> " }, "if": { "description": "If quot1 evaluates to true then evaluates quot2, otherwise evaluates quot3.", "kind": "symbol", + "module": "global", "name": "if", "signature": "quot1 quot2 quot3 ==> a*" }, "import": { "description": "Imports the a previously-loaded module 'sym, defining all its symbols in the current scope.", "kind": "symbol", + "module": "global", "name": "import", "signature": "'sym ==> " }, "in?": { "description": "Returns true if a is contained in quot, false otherwise.", "kind": "symbol", + "module": "seq", "name": "in?", "signature": "quot a ==> bool" }, "indent": { "description": "Returns str containing 'sym indented with int spaces.", "kind": "symbol", + "module": "str", "name": "indent", "signature": "'sym int ==> str" }, "indexof": { "description": "If str2 is contained in str1, returns the index of the first match or -1 if no match is found.", "kind": "symbol", + "module": "str", "name": "indexof", "signature": "str1 str2 ==> int" }, "inf": { "description": "Returns infinity.", "kind": "symbol", + "module": "num", "name": "inf", "signature": " ==> num" }, "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", + "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", "kind": "symbol", + "module": "global", "name": "infix-dequote", "signature": "quot ==> a" }, "info": { "description": "Prints a and a new line to STDOUT, if logging level is set to [info](class:kwd) or lower.", "kind": "symbol", + "module": "io", "name": "info", "signature": "a ==> a" }, "insert": { "description": "Inserts a as the value of the _n^th_ element quot1 (zero-based), and returns the modified copy of the quotation quot2.", "kind": "symbol", + "module": "seq", "name": "insert", "signature": "quot1 a int ==> quot2" }, "integer": { - "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.", + "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.", "kind": "symbol", + "module": "global", "name": "integer", "signature": "a ==> int" }, "integer?": { "description": "Returns true if a is an integer, false otherwise.", "kind": "symbol", + "module": "logic", "name": "integer?", "signature": "a ==> bool" }, "interpolate": { - "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.\"", + "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.\"", "kind": "symbol", + "module": "str", "name": "interpolate", "signature": "str quot ==> str" }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "intersection", "signature": "quot1 quot2 ==> quot3" }, - "invoke": { - "description": "Assuming 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*" - }, "join": { "description": "Joins the elements of quot using separator 'sym, producing str.", "kind": "symbol", + "module": "str", "name": "join", "signature": "quot 'sym ==> str" }, "join-path": { "description": "Joins the strings contained in quot with /.", "kind": "symbol", + "module": "fs", "name": "join-path", "signature": "quot ==> str" }, "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 '+ 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 '+ keep", "kind": "symbol", + "module": "stack", "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.\r\n\r\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.\n \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", "signature": "quot 'sym ==> " }, "lambda-bind": { "description": "Binds the specified quotation to an existing symbol 'sym which was previously-set via lambda.", "kind": "symbol", + "module": "global", "name": "lambda-bind", "signature": "quot 'sym ==> " }, "lambdabind": { "description": "See lambda-bind", "kind": "symbol", + "module": "global", "name": "lambdabind" }, "last": { "description": "Returns the last element of quot.", "kind": "symbol", + "module": "seq", "name": "last", "signature": "quot ==> a" }, "length": { "description": "Returns the length of 'sym.", "kind": "symbol", + "module": "str", "name": "length", "signature": "'sym ==> int" }, "line-info": { "description": "Returns a dictionary dict containing a **filename**, **line**, and **column** properties identifying the filename, line and column of the current symbol.", "kind": "symbol", + "module": "global", "name": "line-info", "signature": " ==> dict" }, "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", + "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", "kind": "symbol", + "module": "global", "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.\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", + "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", "kind": "symbol", + "module": "net", "name": "listen", "signature": "dict dict:socket1 ==> dict:socket2" }, "ln": { "description": "Calculates the natural logarithm of num1.", "kind": "symbol", + "module": "math", "name": "ln", "signature": "num1 ==> num2" }, "load": { "description": "Parses and interprets the specified min file 'sym, adding [.min](class:ext) if not specified.", "kind": "symbol", + "module": "global", "name": "load", "signature": "'sym ==> a*" }, "load-symbol": { "description": "Loads the contents of symbol 'sym from the [.min\\_symbols](class:file) file.", "kind": "symbol", + "module": "global", "name": "load-symbol", "signature": "'sym ==> a*" }, "log10": { "description": "Calculates the common logarithm of num1.", "kind": "symbol", + "module": "math", "name": "log10", "signature": "num1 ==> num2" }, "log2": { "description": "Calculates the binary logarithm of num1.", "kind": "symbol", + "module": "math", "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:\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_.", + "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_.", "kind": "symbol", + "module": "global", "name": "loglevel", "signature": "'sym ==> " }, "loglevel?": { "description": "Returns the current log level (debug, info, notice, warn, error or fatal).", "kind": "symbol", + "module": "global", "name": "loglevel?", "signature": " ==> str" }, "lowercase": { "description": "Returns a copy of 'sym converted to lowercase.", "kind": "symbol", + "module": "str", "name": "lowercase", "signature": "'sym ==> str" }, "ls": { "description": "Returns a quotation quot containing all children (files and directories) of the directory 'sym.", "kind": "symbol", + "module": "sys", "name": "ls", "signature": "'sym ==> quot" }, "ls-r": { "description": "Returns a quotation quot containing all children (files and directories) of the directory 'sym, recursively.", "kind": "symbol", + "module": "sys", "name": "ls-r", "signature": "'sym ==> quot" }, "map": { "description": "Returns a new quotation quot3 obtained by applying quot2 to each element of quot1.", "kind": "symbol", + "module": "seq", "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.\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", + "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", "kind": "symbol", + "module": "seq", "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. \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 mapkey \r\n \r\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. \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 mapkey \n \n causes the CTRL+L key to clear the screen.", "kind": "symbol", + "module": "io", "name": "mapkey", "signature": "quot 'sym ==> " }, "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", + "description": "Returns true if str2 matches str1, false otherwise.\n \n Tip\n \n str2 is a Perl-compatible regular expression", "kind": "symbol", + "module": "str", "name": "match?", "signature": "str1 str2 ==> bool" }, "md4": { "description": "Returns the MD4 hash of 'sym.", "kind": "symbol", + "module": "crypto", "name": "md4", "signature": "'sym ==> str" }, "md5": { "description": "Returns the MD5 hash of 'sym.", "kind": "symbol", + "module": "crypto", "name": "md5", "signature": "'sym ==> str" }, "med": { "description": "Returns the median of the items of quot.", "kind": "symbol", + "module": "num", "name": "med", "signature": "quot ==> num" }, "mkdir": { "description": "Creates the specified directory 'sym.", "kind": "symbol", + "module": "sys", "name": "mkdir", "signature": "'sym ==> " }, "mod": { "description": "Returns the integer module of int1 divided by int2.", "kind": "symbol", + "module": "num", "name": "mod", "signature": "int1 int2 ==> int3" }, "mtime": { "description": "Returns a timestamp corresponding to the time that file/directory 'sym was last modified.", "kind": "symbol", + "module": "fs", "name": "mtime", "signature": "'sym ==> flt" }, "mv": { "description": "Moves the file or directory 'sym1 to 'sym2.", "kind": "symbol", + "module": "sys", "name": "mv", "signature": "'sym1 'sym2 ==> " }, "nan": { "description": "Returns **NaN** (not a number).", "kind": "symbol", + "module": "num", "name": "nan", "signature": " ==> nan" }, "newline": { "description": "Prints a new line to STDOUT.", "kind": "symbol", + "module": "io", "name": "newline", "signature": " ==> " }, "nip": { "description": "Removes the second element from the stack.", "kind": "symbol", + "module": "stack", "name": "nip", "signature": "a1 a2 ==> a2" }, "normalized-path": { "description": "Returns the normalized path to 'sym.", "kind": "symbol", + "module": "fs", "name": "normalized-path", "signature": "'sym ==> str" }, "not": { "description": "Negates bool1.", "kind": "symbol", + "module": "logic", "name": "not", "signature": "bool1 ==> bool2" }, "notice": { "description": "Prints a and a new line to STDOUT, if logging level is set to [notice](class:kwd) (default) or lower.", "kind": "symbol", + "module": "io", "name": "notice", "signature": "a ==> a" }, "now": { "description": "Returns the current time as Unix timestamp with microseconds.", "kind": "symbol", + "module": "time", "name": "now", "signature": " ==> flt" }, "null?": { "description": "Returns true if a is null, false otherwise.", "kind": "symbol", + "module": "logic", "name": "null?", "signature": "a ==> bool" }, "number?": { "description": "Returns true if a is a number, false otherwise.", "kind": "symbol", + "module": "logic", "name": "number?", "signature": "a ==> bool" }, "odd?": { "description": "Returns true if int is odd, false otherwise.", "kind": "symbol", + "module": "num", "name": "odd?", "signature": "int ==> bool" }, "one?": { "description": "Applies predicate quot2 to each element of quot1 and returns true if only one element of quot1 satisfies predicate quot2, false otherwise.", "kind": "symbol", + "module": "seq", "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.\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 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 ) ::", + "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 ) ::", "kind": "symbol", + "module": "global", "name": "operator", "signature": "quot ==> a*" }, "opts": { "description": "Returns a dictionary of all options passed to the current program, with their respective values.", "kind": "symbol", + "module": "global", "name": "opts", "signature": " ==> dict" }, "or": { "description": "Returns true if bool1 or bool2 is true, false otherwise.", "kind": "symbol", + "module": "logic", "name": "or", "signature": "bool1 bool2 ==> bool3" }, "ord": { "description": "Returns the ASCII code int corresponding to the single character str.", "kind": "symbol", + "module": "str", "name": "ord", "signature": "str ==> int" }, "os": { "description": "Returns the host operating system. It can be one of the following strings: windows, macosx, linux, netbsd, freebsd, openbsd, solaris, aix, standalone.", "kind": "symbol", + "module": "sys", "name": "os", "signature": " ==> str" }, "over": { "description": "Pushes a copy of the second element on top of the stack.", "kind": "symbol", + "module": "stack", "name": "over", "signature": "a1 a2 ==> a1 a2 a1" }, + "parent-dir": { + "description": "Returns the full path to the parent directory.", + "kind": "symbol", + "module": "sys", + "name": "parent-dir", + "signature": " ==> str" + }, "parent-scope": { "description": "Returns a dictionary dict2 holding a reference to the parent scope of dict1 or null if dict1 is global.", "kind": "symbol", + "module": "global", "name": "parent-scope", "signature": "dict1 ==> dict2" }, "parse": { "description": "Parses str and returns a quoted program quot.", "kind": "symbol", + "module": "global", "name": "parse", "signature": "str ==> quot" }, "parse-url": { "description": "Parses the url str into its components and stores them into dict:url.", "kind": "symbol", + "module": "str", "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.\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", + "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", "kind": "symbol", + "module": "seq", "name": "partition", "signature": "quot1 quot2 ==> quot3 quot4" }, "password": { "description": "Reads a line from STDIN displaying \\* for each typed character, and places it on top of the stack as a string.", "kind": "symbol", + "module": "io", "name": "password", "signature": " ==> str" }, "pi": { "description": "Returns the value of the &pi; constant.", "kind": "symbol", + "module": "math", "name": "pi", "signature": " ==> num" }, "pick": { "description": "Pushes a copy of the third element on top of the stack.", "kind": "symbol", + "module": "stack", "name": "pick", "signature": "a1 a2 a3 ==> a1 a2 a3 a1" }, "pop": { "description": "Removes the first element from the stack.", "kind": "symbol", + "module": "stack", "name": "pop", "signature": "a ==> " }, "pow": { "description": "Computes num1 to power raised of num2.", "kind": "symbol", + "module": "math", "name": "pow", "signature": "num1 num2 ==> num3" }, "pred": { "description": "Returns the predecessor of int1.", "kind": "symbol", + "module": "num", "name": "pred", "signature": "int1 ==> int2" }, "prefix": { "description": "Prepends 'sym2 to 'sym1.", "kind": "symbol", + "module": "str", "name": "prefix", "signature": "'sym1 'sym2 ==> str" }, "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", + "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", "kind": "symbol", + "module": "global", "name": "prefix-dequote", "signature": "quot ==> a" }, "prepend": { "description": "Returns a new quotation containing the contents of quot with a prepended.", "kind": "symbol", + "module": "seq", "name": "prepend", "signature": "a quot ==> (a a*)" }, "print": { "description": "Prints a to STDOUT.", "kind": "symbol", + "module": "io", "name": "print", "signature": "a ==> a" }, "product": { "description": "Returns the product of all items of quot. quot is a quotation of integers.", "kind": "symbol", + "module": "num", "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:\r\n \r\n (\"[$1]$$ \" (.) = %)\r\n \r\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:\n \n (\"[$1]$$ \" (.) = %)\n \n Unlike other predefined symbols, this symbol is _unsealed_, which means it can be modified.", "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", + "description": "Publishes symbol 'sym to the scope of dict.\n \n \n Example\n \n Publish symbol [my-local-symbol](class:kwd) to [global](class:kwd) scope:\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", + "module": "global", "name": "put-env", "signature": "'sym1 'sym2 ==> str" }, "putchr": { "description": "Prints str to STDOUT without printing a new line (str must contain only one character).", "kind": "symbol", + "module": "io", "name": "putchr", "signature": "str ==> a" }, "puts": { "description": "Prints a and a new line to STDOUT.", "kind": "symbol", + "module": "global", "name": "puts", "signature": "a ==> a" }, + "pwd": { + "description": "Returns the full path to the current directory.", + "kind": "symbol", + "module": "sys", + "name": "pwd", + "signature": " ==> str" + }, "quit": { "description": "Exits the program or shell with 0 as return code.", "kind": "symbol", + "module": "global", "name": "quit", "signature": " ==> " }, "quotation?": { "description": "Returns true if a is a quotation, false otherwise.", "kind": "symbol", + "module": "logic", "name": "quotation?", "signature": "a ==> bool" }, "quote": { "description": "Wraps a in a quotation.", "kind": "symbol", + "module": "global", "name": "quote", "signature": "a ==> (a)" }, "quote-map": { "description": "Returns a new quotation quot2 obtained by quoting each element of quot1.", "kind": "symbol", + "module": "seq", "name": "quote-map", "signature": "quot1 ==> quot2" }, "quotecmd": { "description": "Creates a command with the value of str and wraps it in a quotation.", "kind": "symbol", + "module": "global", "name": "quotecmd", "signature": "str ==> (sym)" }, "quoted-symbol?": { "description": "Returns true if a is a quoted symbol, false otherwise.", "kind": "symbol", + "module": "logic", "name": "quoted-symbol?", "signature": "a ==> bool" }, "quotesym": { "description": "Creates a symbol with the value of str and wraps it in a quotation.", "kind": "symbol", + "module": "global", "name": "quotesym", "signature": "str ==> (sym)" }, "r2d": { "description": "Converts num1 from radians to degrees.", "kind": "symbol", + "module": "math", "name": "r2d", "signature": "num1 ==> num2" }, "raise": { "description": "Raises the error specified via the dictionary dict:error.", "kind": "symbol", + "module": "global", "name": "raise", "signature": "dict:error ==> " }, "random": { - "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.", + "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.", "kind": "symbol", + "module": "num", "name": "random", "signature": "int1 ==> int2" }, "randomize": { "description": "Initializes the random number generator using a seed based on the current timestamp.", "kind": "symbol", + "module": "num", "name": "randomize", "signature": " ==> {{null}" }, "range": { "description": "Takes a quotation quot1 of two or three integers in the form of *start*, *end* and an optional *step* (1 if not specified) and generates the sequence and returns the resulting quotation of integers quot2.", "kind": "symbol", + "module": "num", "name": "range", "signature": "quot2 ==> quot2" }, "raw-args": { "description": "Returns a list of all arguments and (non-parsed) options passed to the current program.", "kind": "symbol", + "module": "global", "name": "raw-args", "signature": " ==> quot" }, "raw-get": { "description": "Returns the _n^th_ element of quot (zero-based) wrapped in a dict:rawval.", "kind": "symbol", + "module": "seq", "name": "raw-get", "signature": "quot int ==> dict:rawval" }, "read": { "description": "See fread", "kind": "symbol", + "module": "io", "name": "read" }, "recv": { "description": "Waits to receive int characters from dict:socket and returns the resulting data str.", "kind": "symbol", + "module": "net", "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.\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", + "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", "kind": "symbol", + "module": "net", "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 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", + "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", "kind": "symbol", + "module": "seq", "name": "reduce", "signature": "quot1 a1 quot2 ==> a2" }, "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", + "module": "seq", "name": "reject", "signature": "quot1 quot2 ==> quot3" }, "relative-path": { "description": "Returns the path of 'sym1 relative to 'sym2.", "kind": "symbol", + "module": "fs", "name": "relative-path", "signature": "'sym1 'sym2 ==> str" }, "remove": { "description": "Returns the _n^th_ element of quot1 (zero-based), and returns the modified copy of the quotation quot2.", "kind": "symbol", + "module": "seq", "name": "remove", "signature": "quot1 int ==> quot2" }, "remove-symbol": { "description": "Removes the symbol 'sym from the [.min\\_symbols](class:file) file.", "kind": "symbol", + "module": "global", "name": "remove-symbol", "signature": "'sym ==> " }, "repeat": { "description": "Returns str containing 'sym repeated int times.", "kind": "symbol", + "module": "str", "name": "repeat", "signature": "'sym int ==> str" }, "replace": { - "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?\"", + "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?\"", "kind": "symbol", + "module": "str", "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.\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:\r\n (\"-1-\" \"1\")\r\n (\"-2-\" \"2\")\r\n (\"-3-\" \"3\")\r\n (\"-4-\" \"4\")", + "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\")", "kind": "symbol", + "module": "str", "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.\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", + "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", "kind": "symbol", + "module": "http", "name": "request", "signature": "dict ==> dict:http-response" }, "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. \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.", + "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.", "kind": "symbol", + "module": "global", "name": "require", "signature": "'sym ==> dict" }, "rest": { "description": "Returns a new quotation quot2 containing all elements of quot1 quotation except for the first.", "kind": "symbol", + "module": "seq", "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. \r\n\r\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. \n\nIf used outside of the body quotation of an operator definition, it raises an exception.", "kind": "symbol", + "module": "global", "name": "return", "signature": " ==> " }, "reverse": { "description": "Returns a new quotation quot2 containing all elements of quot1 in reverse order.", "kind": "symbol", + "module": "seq", "name": "reverse", "signature": "quot1 ==> quot2" }, "rm": { "description": "Deletes the specified file 'sym.", "kind": "symbol", + "module": "sys", "name": "rm", "signature": "'sym ==> " }, "rmdir": { "description": "Deletes the specified directory 'sym and all its subdirectories recursively.", "kind": "symbol", + "module": "sys", "name": "rmdir", "signature": "'sym ==> " }, "rolldown": { "description": "Moves the third element in first position, the second in third position and the the first in second position.", "kind": "symbol", + "module": "stack", "name": "rolldown", "signature": "a1 a2 a3 ==> a2 a3 a1" }, "rollup": { "description": "Moves the third and second element into second and third position and moves the first element into third position.", "kind": "symbol", + "module": "stack", "name": "rollup", "signature": "a1 a2 a3 ==> a3 a2 a1" }, "round": { "description": "Rounds num1 to the int^th decimal place.", "kind": "symbol", + "module": "math", "name": "round", "signature": "num1 int ==> num2" }, "run": { "description": "Executes the external command 'sym in the current directory without displaying its output. Returns a dictionary containing the command output and return code (in keys **output** and **code** respectively).", "kind": "symbol", + "module": "sys", "name": "run", "signature": "'sym ==> dict" }, "save-symbol": { "description": "Saves the contents of symbol 'sym to the [.min\\_symbols](class:file) file.", "kind": "symbol", + "module": "global", "name": "save-symbol", "signature": "'sym ==> " }, "saved-symbols": { "description": "Returns a quotation containing all symbols saved in the [.min\\_symbols](class:file) file.", "kind": "symbol", + "module": "global", "name": "saved-symbols", "signature": " ==> (str*)" }, "scope": { - "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) -", + "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) -", "kind": "symbol", + "module": "global", "name": "scope", "signature": " ==> dict" }, "scope-sigils": { "description": "Returns a list of all sigils defined in dictionary dict.", "kind": "symbol", + "module": "global", "name": "scope-sigils", "signature": "dict ==> (str*)" }, "scope-symbols": { "description": "Returns a list of all symbols defined in dictionary dict.", "kind": "symbol", + "module": "global", "name": "scope-symbols", "signature": "dict ==> (str*)" }, "seal-sigil": { "description": "Seals the user-defined sigil 'sym, so that it cannot be re-defined.", "kind": "symbol", + "module": "global", "name": "seal-sigil", "signature": "'sym ==> " }, "seal-symbol": { "description": "Seals symbol 'sym, so that it cannot be re-assigned.", "kind": "symbol", + "module": "global", "name": "seal-symbol", "signature": "'sym ==> " }, "sealed-sigil?": { "description": "Returns true if the sigil 'sym is sealed, false otherwise.", "kind": "symbol", + "module": "global", "name": "sealed-sigil?", "signature": "'sym ==> bool" }, "sealed-symbol?": { "description": "Returns true if the symbol 'sym is sealed, false otherwise.", "kind": "symbol", + "module": "global", "name": "sealed-symbol?", "signature": "'sym ==> bool" }, "search": { - "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\")", + "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\")", "kind": "symbol", + "module": "str", "name": "search", "signature": "str1 str2 ==> quot" }, "search-all": { "description": "Returns a quotation of quotations (like the one returned by the search operator) containing all occurrences of str2 within str1.", "kind": "symbol", + "module": "str", "name": "search-all", "signature": "str1 str2 ==> quot" }, "semver-inc-major": { "description": "Increments the major digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) str1.", "kind": "symbol", + "module": "str", "name": "semver-inc-major", "signature": "str1 ==> str2" }, "semver-inc-minor": { "description": "Increments the minor digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) str1.", "kind": "symbol", + "module": "str", "name": "semver-inc-minor", "signature": "str1 ==> str2" }, "semver-inc-patch": { "description": "Increments the patch digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) str1.", "kind": "symbol", + "module": "str", "name": "semver-inc-patch", "signature": "str1 ==> str2" }, "semver?": { "description": "Checks whether str is a [SemVer](https://semver.org)-compliant version or not.", "kind": "symbol", + "module": "str", "name": "semver?", "signature": "str ==> bool" }, "send": { "description": "Sends str to the connected socket dict:socket.", "kind": "symbol", + "module": "net", "name": "send", "signature": "dict:socket str ==> " }, "set": { "description": "Sets the value of the _n^th_ element quot1 (zero-based) to a, and returns the modified copy of the quotation quot2.", "kind": "symbol", + "module": "seq", "name": "set", "signature": "quot1 a int ==> quot2" }, "set-stack": { "description": "Substitute the existing stack with the contents of quot.", "kind": "symbol", + "module": "stack", "name": "set-stack", "signature": "quot ==> a*" }, "set-sym": { "description": "Sets the value of the _n^th_ element quot1 (zero-based) to 'sym (treating it as a symbol), and returns the modified copy of the quotation quot2.", "kind": "symbol", + "module": "seq", "name": "set-sym", "signature": "quot1 'sym int ==> quot2" }, "setstack": { "description": "See set-stack", "kind": "symbol", + "module": "stack", "name": "setstack" }, "sha1": { "description": "Returns the SHA1 hash of 'sym.", "kind": "symbol", + "module": "crypto", "name": "sha1", "signature": "'sym ==> str" }, "sha224": { "description": "Returns the SHA224 hash of 'sym.", "kind": "symbol", + "module": "crypto", "name": "sha224", "signature": "'sym ==> str" }, "sha256": { "description": "Returns the SHA256 hash of 'sym.", "kind": "symbol", + "module": "crypto", "name": "sha256", "signature": "'sym ==> str" }, "sha384": { "description": "Returns the SHA384 hash of 'sym.", "kind": "symbol", + "module": "crypto", "name": "sha384", "signature": "'sym ==> str" }, "sha512": { "description": "Returns the SHA512 hash of 'sym.", "kind": "symbol", + "module": "crypto", "name": "sha512", "signature": "'sym ==> str" }, "shl": { "description": "Computes the *shift left* operation of int1 and int2.", "kind": "symbol", + "module": "num", "name": "shl", "signature": "int1 int2 ==> int3" }, "shorten": { "description": "Returns a quotation quot2 containing the first _n_ values of the input quotation quot1.", "kind": "symbol", + "module": "seq", "name": "shorten", "signature": "quot1 int ==> quot2" }, "shr": { "description": "Computes the *shift right* operation of int1 and int2.", "kind": "symbol", + "module": "num", "name": "shr", "signature": "int1 int2 ==> int3" }, "sigils": { "description": "Returns a list of all sigils defined in the [global](class:kwd) scope.", "kind": "symbol", + "module": "global", "name": "sigils", "signature": " ==> (str*)" }, "sin": { "description": "Calculates the sine of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "sin", "signature": "num1 ==> num2" }, "sinh": { "description": "Calculates the hyperbolic sine of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "sinh", "signature": "num1 ==> num2" }, "sip": { "description": "Saves the quot1, dequotes quot2, and restores quot1.", "kind": "symbol", + "module": "stack", "name": "sip", "signature": "quot1 quot2 ==> a* quot1" }, "size": { "description": "Returns the length of quot.", "kind": "symbol", + "module": "seq", "name": "size", "signature": "quot ==> int" }, "sleep": { "description": "Halts program execution for int milliseconds.", "kind": "symbol", + "module": "sys", "name": "sleep", "signature": "int ==> " }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "slice", "signature": "quot1 int1 int2 ==> quot2" }, "socket": { - "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).", + "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).", "kind": "symbol", + "module": "net", "name": "socket", "signature": "dict ==> dict:socket" }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "sort", "signature": "quot1 quot2 ==> quot3" }, "source": { "description": "Display the source code of symbol 'sym (if it has been implemented a min quotation).", "kind": "symbol", + "module": "global", "name": "source", "signature": "'sym ==> quot" }, "split": { "description": "Splits 'sym1 using separator 'sym2 (a Perl-compatible regular expression) and returns the resulting strings within the quotation quot.", "kind": "symbol", + "module": "str", "name": "split", "signature": "'sym1 'sym2 ==> quot" }, "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", + "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", "kind": "symbol", + "module": "stack", "name": "spread", "signature": "a* (quot*) ==> a*" }, "sqrt": { "description": "Returns square root of num1.", "kind": "symbol", + "module": "math", "name": "sqrt", "signature": "num1 ==> num2" }, "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", + "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", "kind": "symbol", + "module": "http", "name": "start-server", "signature": "dict ==> " }, "stop-server": { "description": "Stops the currently-running HTTP server. This operator should be used within an HTTP server handler quotation.", "kind": "symbol", + "module": "http", "name": "stop-server", "signature": " ==> " }, "string": { "description": "Converts a to its string representation.", "kind": "symbol", + "module": "global", "name": "string", "signature": "a ==> str" }, "string?": { "description": "Returns true if a is a string, false otherwise.", "kind": "symbol", + "module": "logic", "name": "string?", "signature": "a ==> bool" }, "stringlike?": { "description": "Returns true if a is a string or a quoted symbol, false otherwise.", "kind": "symbol", + "module": "logic", "name": "stringlike?", "signature": "a ==> bool" }, "strip": { "description": "Returns str, which is set to 'sym with leading and trailing spaces removed.", "kind": "symbol", + "module": "str", "name": "strip", "signature": "'sym ==> str" }, "substr": { "description": "Returns a substring str2 obtained by retrieving int2 characters starting from index int1 within str1.", "kind": "symbol", + "module": "str", "name": "substr", "signature": "str1 int1 int2 ==> str2" }, "succ": { "description": "Returns the successor of int1.", "kind": "symbol", + "module": "num", "name": "succ", "signature": "int1 ==> int2" }, "suffix": { "description": "Appends 'sym2 to 'sym1.", "kind": "symbol", + "module": "str", "name": "suffix", "signature": "'sym1 'sym2 ==> str" }, "sum": { "description": "Returns the sum of all items of quot. quot is a quotation of integers.", "kind": "symbol", + "module": "num", "name": "sum", "signature": "quot ==> int" }, "swap": { "description": "Swaps the first two elements on the stack.", "kind": "symbol", + "module": "stack", "name": "swap", "signature": "a1 a2 ==> a2 a1" }, "swons": { "description": "Prepends a1 to the quotation that follows it.", "kind": "symbol", + "module": "stack", "name": "swons", "signature": "(a*) a1 ==> (a1 a*)" }, "symbols": { "description": "Returns a list of all symbols defined in the [global](class:kwd) scope.", "kind": "symbol", + "module": "global", "name": "symbols", "signature": " ==> (str*)" }, "symlink": { "description": "Creates symlink 'sym2 for file or directory 'sym1.", "kind": "symbol", + "module": "sys", "name": "symlink", "signature": "'sym1 'sym2 ==> " }, "symlink?": { "description": "Returns true if the specified path 'sym exists and is a symbolic link.", "kind": "symbol", + "module": "fs", "name": "symlink?", "signature": "'sym ==> bool" }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "symmetric-difference", "signature": "quot1 quot2 ==> quot3" }, "system": { "description": "Executes the external command 'sym in the current directory and pushes its return code on the stack.", "kind": "symbol", + "module": "sys", "name": "system", "signature": "'sym ==> int" }, "take": { "description": "Returns a quotation quot2 containing the first _n_ values of the input quotation quot1, or quot1 itself if int is greater than the length of quot1.", "kind": "symbol", + "module": "seq", "name": "take", "signature": "quot1 int ==> quot2" }, "tan": { "description": "Calculates the tangent of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "tan", "signature": "num1 ==> num2" }, "tanh": { "description": "Calculates the hyperbolic tangent of num1 (in radians).", "kind": "symbol", + "module": "math", "name": "tanh", "signature": "num1 ==> num2" }, "tap": { - "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}.", + "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}.", "kind": "symbol", + "module": "global", "name": "tap", "signature": "a quot ==> a" }, "tau": { "description": "Returns the value of the &tau; constant (2&pi;).", "kind": "symbol", + "module": "math", "name": "tau", "signature": " ==> num" }, "tformat": { - "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.", + "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.", "kind": "symbol", + "module": "time", "name": "tformat", "signature": "int str ==> str" }, "timeinfo": { "description": "Returns a timeinfo dictionary from timestamp int.", "kind": "symbol", + "module": "time", "name": "timeinfo", "signature": "int ==> dict:timeinfo" }, "times": { "description": "Applies the quotation quot int times.", "kind": "symbol", + "module": "global", "name": "times", "signature": "quot int ==> a*" }, "timestamp": { "description": "Returns the current time as Unix timestamp.", "kind": "symbol", + "module": "time", "name": "timestamp", "signature": " ==> int" }, "titleize": { "description": "Returns a copy of 'sym in which the first character of each word is capitalized.", "kind": "symbol", + "module": "str", "name": "titleize", "signature": "'sym ==> str" }, "to-bin": { "description": "Converts int to its binary representation.", "kind": "symbol", + "module": "str", "name": "to-bin", "signature": "int ==> str" }, "to-dec": { "description": "Converts int to its decimal representation.", "kind": "symbol", + "module": "str", "name": "to-dec", "signature": "int ==> str" }, "to-hex": { "description": "Converts int to its hexadecimal representation.", "kind": "symbol", + "module": "str", "name": "to-hex", "signature": "int ==> str" }, "to-json": { "description": "Converts a into a JSON string.", "kind": "symbol", + "module": "global", "name": "to-json", "signature": "a ==> str" }, "to-oct": { "description": "Converts int to its octal representation.", "kind": "symbol", + "module": "str", "name": "to-oct", "signature": "int ==> str" }, "to-semver": { "description": "Given a a dictionary dict containing a **major**, **minor**, and **patch** key/value pairs , it pushes a basic [SemVer](https://semver.org)-compliant string (with no additional labels) str on the stack.", "kind": "symbol", + "module": "str", "name": "to-semver", "signature": "dict ==> str" }, "to-timestamp": { "description": "Converts the timeinfo dictionary dict:timeinfo to the corresponding Unix timestamp.", "kind": "symbol", + "module": "time", "name": "to-timestamp", "signature": "dict:timeinfo ==> int" }, "to-xml": { "description": "Returns a str representing an XML node.", "kind": "symbol", + "module": "xml", "name": "to-xml", "signature": "xml-node ==> str" }, "to-yaml": { - "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.", + "description": "Converts a into a YAML string.\n\n \n Note\n \n At present, only min dictionaries containing string values are supported.", "kind": "symbol", + "module": "global", "name": "to-yaml", "signature": "a ==> str" }, + "tokenize": { + "description": "Parses the min program str and returns a quotation quot containing dictionaries with a type symbol and a value symbol for each token.", + "kind": "symbol", + "module": "global", + "name": "tokenize", + "signature": "str ==> quot" + }, "trunc": { "description": "Truncates num to the decimal point.", "kind": "symbol", + "module": "math", "name": "trunc", "signature": "num1 ==> num2" }, "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", + "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", "kind": "symbol", + "module": "global", "name": "try", "signature": "(quot1 quot2? quot3?) ==> a*" }, "type": { "description": "Puts the data type of a on the stack. In cased of typed dictionaries, the type name is prefixed by dict:, e.g. dict:module, dict:socket, etc.", "kind": "symbol", + "module": "io", "name": "type", "signature": "a ==> str" }, "type?": { "description": "Returns true if the data type of a satisfies the specified type expression 'sym, false otherwise.", "kind": "symbol", + "module": "logic", "name": "type?", "signature": "a 'sym ==> bool" }, "typealias": { "description": "Creates a type alias 'sym1 for type expression 'sym2.", "kind": "symbol", + "module": "global", "name": "typealias", "signature": "'sym1 'sym2 ==> " }, "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", + "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", "kind": "symbol", + "module": "seq", "name": "union", "signature": "quot1 quot2 ==> quot3" }, "unix-path": { "description": "Converts all backslashes in 'sym to slashes.", "kind": "symbol", + "module": "fs", "name": "unix-path", "signature": "'sym ==> str" }, "unless": { "description": "If 1 evaluates to false then evaluates 2.", "kind": "symbol", + "module": "global", "name": "unless", "signature": "quot1 quot2 ==> a*" }, "unmapkey": { - "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.", + "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.", "kind": "symbol", + "module": "io", "name": "unmapkey", "signature": "'sym ==> " }, "unseal-sigil": { "description": "Unseals sigil 'sym, so that it can be re-defined (system sigils cannot be unsealed).", "kind": "symbol", + "module": "global", "name": "unseal-sigil", "signature": "'sym ==> " }, "unseal-symbol": { "description": "Unseals the user-defined symbol 'sym, so that it can be re-assigned.", "kind": "symbol", + "module": "global", "name": "unseal-symbol", "signature": "'sym ==> " }, "unzip": { "description": "Decompresses zip file 'sym1 to directory 'sym2 (created if not present).", "kind": "symbol", + "module": "sys", "name": "unzip", "signature": "'sym1 'sym2 ==> " }, "uppercase": { "description": "Returns a copy of 'sym converted to uppercase.", "kind": "symbol", + "module": "str", "name": "uppercase", "signature": "'sym1 ==> 'sym2" }, "version": { "description": "Returns the current min version number.", "kind": "symbol", + "module": "global", "name": "version", "signature": " ==> str" }, "warn": { "description": "Prints a and a new line to STDERR, if logging level is set to [warn](class:kwd) or lower.", "kind": "symbol", + "module": "io", "name": "warn", "signature": "a ==> a" }, "when": { "description": "If quot1 evaluates to true then evaluates quot2.", "kind": "symbol", + "module": "global", "name": "when", "signature": "quot1 quot2 ==> a*" }, "which": { "description": "Returns the full path to the directory containing executable 'sym, or an empty string if the executable is not found in **$PATH**.", "kind": "symbol", + "module": "sys", "name": "which", "signature": "'sym ==> str" }, "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", + "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", "kind": "symbol", + "module": "global", "name": "while", "signature": "quot1 quot2 ==> a*" }, "windows-path": { "description": "Converts all slashes in 'sym to backslashes.", "kind": "symbol", + "module": "fs", "name": "windows-path", "signature": "'sym ==> str" }, "with": { "description": "Pushes each item of quot1 on the stack using the scope of quot2 as scope.", "kind": "symbol", + "module": "global", "name": "with", "signature": "quot1 quot2 ==> a*" }, "write": { "description": "See fwrite", "kind": "symbol", + "module": "io", "name": "write" }, "xcdata": { "description": "Returns a dict:xml-cdata representing an XML CDATA section.", "kind": "symbol", + "module": "xml", "name": "xcdata", "signature": "'sym ==> dict:xml-cdata" }, "xcomment": { "description": "Returns a dict:xml-comment representing an XML comment.", "kind": "symbol", + "module": "xml", "name": "xcomment", "signature": "'sym ==> dict:xml-comment" }, "xelement": { "description": "Returns a dict:xml-element representing an XML element (it will be an empty element with no attributes or children).", "kind": "symbol", + "module": "xml", "name": "xelement", "signature": "'sym ==> dict:xml-element" }, "xentity": { "description": "Returns a dict:xml-entity representing an XML entity.", "kind": "symbol", + "module": "xml", "name": "xentity", "signature": "'sym ==> dict:xml-entity" }, + "xentity2utf8": { + "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 \"&gt;\" xentity xentity2utf8 puts", + "kind": "symbol", + "module": "xml", + "name": "xentity2utf8", + "signature": "dict:xml-entity ==> str" + }, + "xescape": { + "description": "Converts any <, `, &, ', and \"` present in 'sym into the corresponding XML entities.", + "kind": "symbol", + "module": "xml", + "name": "xescape", + "signature": "'sym ==> str" + }, "xor": { "description": "Returns true if bool1 and bool2 are different, false otherwise.", "kind": "symbol", + "module": "logic", "name": "xor", "signature": "bool1 bool2 ==> bool3" }, "xquery": { - "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 from-xml \".test\" xquery\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 }", + "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 from-xml \".test\" xquery\n Returns the following:\n\n {\n {\"test\" :class} :attributes \n ({\"first\" :text}) :children \n \"li\" :tag \n ;xml-element\n }", "kind": "symbol", + "module": "xml", "name": "xquery", "signature": "dict:xml-element 'sym ==> dict:xml-element" }, "xqueryall": { - "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 from-xml \".test\" xqueryall\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 })", + "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 from-xml \".test\" xqueryall\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 })", "kind": "symbol", + "module": "xml", "name": "xqueryall", "signature": "dict:xml-element 'sym ==> dict:xml-element" }, "xtext": { "description": "Returns a dict:xml-text representing an XML text node.", "kind": "symbol", + "module": "xml", "name": "xtext", "signature": "'sym ==> dict:xml-text" }, "zip": { "description": "Compresses files included in quotation quot into zip file 'sym.", "kind": "symbol", + "module": "sys", "name": "zip", "signature": "quot 'sym ==> " }, "~": { "description": "See lambda-bind", "kind": "symbol", - "name": "~" - } - }, - "sigils": { - "!": { - "description": "See system", - "kind": "sigil", - "name": "!" - }, - "$": { - "description": "See get-env", - "kind": "sigil", - "name": "$" - }, - "%": { - "description": "See dset", - "kind": "sigil", - "name": "%" - }, - "&": { - "description": "See run", - "kind": "sigil", - "name": "&" - }, - "'": { - "description": "See quotesym", - "kind": "sigil", - "name": "'" - }, - "*": { - "description": "See invoke", - "kind": "sigil", - "name": "*" - }, - "/": { - "description": "See dget", - "kind": "sigil", - "name": "/" - }, - ":": { - "description": "See define", - "kind": "sigil", - "name": ":" - }, - "<": { - "description": "See load-symbol", - "kind": "sigil", - "name": "<" - }, - ">": { - "description": "See save-symbol", - "kind": "sigil", - "name": ">" - }, - "?": { - "description": "See help", - "kind": "sigil", - "name": "?" - }, - "@": { - "description": "See bind", - "kind": "sigil", - "name": "@" - }, - "^": { - "description": "See lambda", - "kind": "sigil", - "name": "^" - }, - "~": { - "description": "See lambda-bind", - "kind": "sigil", + "module": "global", "name": "~" } }
M min.nimmin.nim

@@ -11,7 +11,6 @@ baseutils,

env, parser, value, - scope, interpreter, stdlib, shell,

@@ -29,7 +28,6 @@ interpreter,

utils, value, shell, - scope, stdlib, min_global, niftylogger

@@ -209,9 +207,8 @@ customPrelude = val

of "dev", "d": DEV = true of "log", "l": - if file == "": - var val = val - niftylogger.setLogLevel(val) + var v = val + niftylogger.setLogLevel(v) of "passN", "n": NIMOPTIONS = val of "help", "h":
M min.nimblemin.nimble

@@ -1,11 +1,13 @@

# Package -version = "0.43.1" author = "Fabio Cevasco" +version = "0.44.0" +author = "Fabio Cevasco" description = "A small but practical concatenative programming language and shell." license = "MIT" bin = @["min"] installExt = @["nim", "c", "h", "a"] installFiles = @["min.yml", "min.nim", "prelude.min", "help.json"] +skipFiles = @["mintool.min"] installDirs = @["minpkg"] # Dependencies

@@ -14,4 +16,4 @@ requires "nim >= 2.0.0 & < 3.0.0"

requires "checksums" requires "zippy >= 0.5.6 & < 0.6.0" requires "nimquery >= 2.0.1 & < 3.0.0" -requires "minline >= 0.1.1 & < 0.2.0" +requires "minline >= 0.1.2 & < 0.2.0"
M min.ymlmin.yml

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

author: Fabio Cevasco description: A small but practical concatenative programming language and shell. -id: 153992690 +id: 154260810 name: min -version: 0.43.1+version: 0.44.0
M minpkg/core/env.nimminpkg/core/env.nim

@@ -22,4 +22,6 @@ var MINCOMPILED* {.threadvar.}: bool

MINCOMPILED = false var DEV* {.threadvar.}: bool DEV = false +var COLOR* {.threadvar.}: bool +COLOR = true
M minpkg/core/interpreter.nimminpkg/core/interpreter.nim

@@ -3,6 +3,7 @@ std/[streams,

strutils, sequtils, os, + nre, osproc, critbits, json,

@@ -12,7 +13,6 @@ logging]

import baseutils, value, - scope, parser type

@@ -27,7 +27,8 @@ var COMPILEDMINFILES* {.threadvar.}: CritBitTree[MinOperatorProc]

var COMPILEDASSETS* {.threadvar.}: CritBitTree[string] var CACHEDMODULES* {.threadvar.}: CritBitTree[MinValue] -const USER_SYMBOL_REGEX* = "^[a-zA-Z_][a-zA-Z0-9/!?+*._-]*$" +const USER_SYMBOL_REGEX* = "^[a-zA-Z_][a-zA-Z0-9/!?+*_-]*$" +const USER_PATH_SYMBOL_REGEX* = "^[a-zA-Z_][a-zA-Z0-9/.!?+*_-]*$" proc diff*(a, b: seq[MinValue]): seq[MinValue] = result = newSeq[MinValue](0)

@@ -193,7 +194,20 @@ return v

proc apply*(i: In, op: MinOperator, sym = "") {.effectsOf: op.} = if op.kind == minProcOp: - op.prc(i) + if not op.mdl.isNil and not op.mdl.scope.isNil and not i.scope.hasParent op.mdl.scope: + # Capture closures at module level + let origScope = i.scope + let origParentScope = i.scope.parent + let origMdlParentScope = op.mdl.scope.parent + i.scope = op.mdl.scope + i.scope.parent = origScope + i.scope.parent.parent = origParentScope + op.prc(i) + i.scope = origScope + i.scope.parent = origParentScope + op.mdl.scope.parent = origMdlParentScope + else: + op.prc(i) else: if op.val.kind == minQuotation: var newscope = newScopeRef(i.scope)

@@ -237,6 +251,7 @@ proc pop*(i: In): MinValue =

if i.stack.len > 0: return i.stack.pop else: + debug "pop - empty stack!" raiseEmptyStack() # Inherit file/line/column from current symbol

@@ -262,27 +277,38 @@ i.trace.add val

let symbol = val.symVal if symbol == "return": raise MinReturnException(msg: "return symbol found") - if i.scope.hasSymbol(symbol): - i.apply i.scope.getSymbol(symbol), symbol + i.debug("push: $#" % [symbol]) + let op = i.scope.getSymbol(symbol) + if not op.isNull: + i.debug("push: symbol found: $#" % [symbol]) + i.apply op, symbol else: # Check if symbol ends with ! (auto-popping) if symbol.len > 1 and symbol[symbol.len-1] == '!': + i.debug("push - checking auto-popping symbol: $#" % [symbol]) let apSymbol = symbol[0..symbol.len-2] - if i.scope.hasSymbol(apSymbol): - i.apply i.scope.getSymbol(apSymbol) + let apOp = i.scope.getSymbol(apSymbol) + if not apOp.isNull: + i.apply apOp discard i.pop else: + i.debug("push - checking sigil: $#" % [symbol]) + # Check user-defined sigil var qIndex = symbol.find('"') if qIndex > 0: let sigil = symbol[0..qIndex-1] + i.debug("push - checking user sigil: $#" % [sigil]) if not i.scope.hasSigil(sigil): raiseUndefined("Undefined sigil '$1'"%sigil) i.stack.add(MinValue(kind: minString, strVal: symbol[ qIndex+1..symbol.len-2])) i.apply(i.scope.getSigil(sigil)) else: + # Check system sigil let sigil = "" & symbol[0] + i.debug("push - checking system sigil: $#" % [sigil]) if symbol.len > 1 and i.scope.hasSigil(sigil): + i.debug("Processing sigil: $# ($#)" % [sigil, symbol]) i.stack.add(MinValue(kind: minString, strVal: symbol[ 1..symbol.len-1])) i.apply(i.scope.getSigil(sigil))

@@ -304,6 +330,7 @@ proc peek*(i: MinInterpreter): MinValue =

if i.stack.len > 0: return i.stack[i.stack.len-1] else: + debug "peek - empty stack!" raiseEmptyStack() template handleErrors*(i: In, body: untyped) =

@@ -369,6 +396,8 @@ if files.len > 0 or (ASSETPATH != ""):

result.add "import critbits" if ASSETPATH != "": result.add "import base64" + result.add "import logging" + result.add "logging.setLogFilter(logging.lvlNotice)" result.add "MINCOMPILED = true" result.add "var i = newMinInterpreter(\"$#\")" % i.filename result.add "i.stdLib()"

@@ -436,7 +465,10 @@ raiseInvalid("Module '$#' is polluting the stack -- $#" % [s, $d.newVal])

result = newDict(i2.scope) result.objType = "module" for key, value in i2.scope.symbols.pairs: - result.scope.symbols[key] = value + var v = value + if v.kind == minProcOp: + v.mdl = result + result.scope.symbols[key] = v CACHEDMODULES[s] = result proc parse*(i: In, s: string, name = "<parse>"): MinValue =
M minpkg/core/niftylogger.nimminpkg/core/niftylogger.nim

@@ -4,6 +4,9 @@ strutils,

terminal, exitprocs] +import + ./env + if isatty(stdin): addExitProc(resetAttributes)

@@ -34,10 +37,12 @@ if level >= lvlWarn:

f = stderr let ln = substituteLog(logger.fmtStr, level, args) let prefix = level.logPrefix() - f.setForegroundColor(prefix.color) + if COLOR: + f.setForegroundColor(prefix.color) f.write(prefix.msg) f.write(ln) - resetAttributes() + if COLOR: + resetAttributes() f.write("\n") if level in {lvlError, lvlFatal}: flushFile(f)

@@ -69,5 +74,5 @@ lvl = lvlNone

else: val = "warn" lvl = lvlWarn - setLogFilter(lvl) + logging.setLogFilter(lvl) return val
M minpkg/core/parser.nimminpkg/core/parser.nim

@@ -5,6 +5,7 @@ strutils,

sequtils, streams, critbits, + logging, json] import

@@ -110,10 +111,10 @@ minValOp

MinOperator* = object sealed*: bool doc*: JsonNode + mdl*: MinValue # Only set in case of modules case kind*: MinOperatorKind of minProcOp: prc*: MinOperatorProc - mdl*: MinValue # Only set in case of modules of minValOp: quotation*: bool val*: MinValue

@@ -697,6 +698,9 @@ d = d & ";" & a.objType

d = d.strip & "}" return d +proc setSymbol*(scope: ref MinScope, key: string, value: MinOperator, + override = false, define = false): bool {.discardable.} + proc parseMinValue*(p: var MinParser, i: In): MinValue = case p.token of tkNull:

@@ -861,8 +865,8 @@ result.add indent&valvar&" = "&vs

elif v.kind == minSymbol: let key = v.symVal if key[0] == ':': - result.add indent&scopevar&".symbols["&key[1 .. - key.len-1]&"] = MinOperator(kind: minValOp, val: "&valvar&", sealed: false)" + result.add indent&scopevar&".setSymbol("&key[1 .. + key.len-1]&"), MinOperator(kind: minValOp, val: "&valvar&", sealed: false))" val = nil else: raiseInvalid("Invalid dictionary key: " & key)

@@ -990,3 +994,182 @@ else:

return false else: return false + +## Scope-related methods + +proc copy*(s: ref MinScope): ref MinScope = + var scope = newScope(s.parent) + scope.symbols = s.symbols + scope.sigils = s.sigils + new(result) + result[] = scope + +proc getDictionary(d: MinOperator): MinValue = + if d.kind == minProcOp: + return d.mdl + elif d.kind == minValOp and d.val.kind == minQuotation and d.val.qVal.len == + 1 and d.val.qVal[0].kind == minDictionary: + return d.val.qVal[0] + elif d.kind == minValOp and d.val.kind == minDictionary: + return d.val + +proc getSymbolFromPath(scope: ref MinScope, keys: var seq[ + string]): MinOperator + +proc isNull*(op: MinOperator): bool = + return op.kind == minValOp and op.val.kind == minNull + +proc getSymbol*(scope: ref MinScope, key: string): MinOperator = + debug "getSymbol: $#" % [key] + if scope.symbols.hasKey(key): + return scope.symbols[key] + elif key.contains ".": + var keys = key.split(".") + return getSymbolFromPath(scope, keys) + else: + if scope.parent.isNil: + debug("Unable to retrieve symbol '$1' (not found)." % key) + return MinOperator(kind: minValOp, val: MinValue(kind: minNull)) + return scope.parent.getSymbol(key) + +proc getSymbolFromPath(scope: ref MinScope, keys: var seq[ + string]): MinOperator = + let sym = keys[0] + keys.delete(0) + let d = scope.getSymbol(sym) + let dict = d.getDictionary + if not dict.isNil: + if keys.len > 1: + return dict.scope.getSymbolFromPath(keys) + else: + return dict.scope.getSymbol(keys[0]) + else: + debug("Symbol '$1' is not a dictionary." % sym) + return MinOperator(kind: minValOp, val: MinValue(kind: minNull)) + +proc delSymbolFromPath(scope: ref MinScope, keys: var seq[ + string]): bool + +proc delSymbol*(scope: ref MinScope, key: string): bool {.discardable.} = + if scope.symbols.hasKey(key): + if scope.symbols[key].sealed: + raiseInvalid("Symbol '$1' is sealed." % key) + scope.symbols.excl(key) + return true + elif key.contains ".": + var keys = key.split(".") + return delSymbolFromPath(scope, keys) + return false + +proc delSymbolFromPath(scope: ref MinScope, keys: var seq[ + string]): bool = + let sym = keys[0] + keys.delete(0) + let d = scope.getSymbol(sym) + let dict = d.getDictionary + if not dict.isNil: + if keys.len > 1: + return dict.scope.delSymbolFromPath(keys) + else: + return dict.scope.delSymbol(keys[0]) + else: + raiseInvalid("Symbol '$1' is not a dictionary." % sym) + +proc setSymbolFromPath(scope: ref MinScope, keys: var seq[ + string], value: MinOperator, override = false, + define = false): bool {.discardable.} + +proc setSymbol*(scope: ref MinScope, key: string, value: MinOperator, + override = false, define = false): bool {.discardable.} = + result = false + # check if a symbol already exists in current scope + debug "setSymbol: $#" % [key] + if not scope.isNil and scope.symbols.hasKey(key): + if not override and scope.symbols[key].sealed: + raiseInvalid("Symbol '$1' is sealed ." % key) + scope.symbols[key] = value + debug "setSymbol (existing): $# = $#" % [key, $value] + result = true + elif key.contains ".": + var keys = key.split(".") + return setSymbolFromPath(scope, keys, value, override, define) + # define new symbol + elif not scope.isNil and define: + debug "setSymbol (new): $# = $#" % [key, $value] + scope.symbols[key] = value + result = true + else: + # Go up the scope chain and attempt to find the symbol + if not scope.parent.isNil: + result = scope.parent.setSymbol(key, value, override, define) + else: + debug "setSymbol: failure to set: $# = $#" % [key, $value] + +proc setSymbolFromPath(scope: ref MinScope, keys: var seq[ + string], value: MinOperator, override = false, + define = false): bool {.discardable.} = + let sym = keys[0] + keys.delete(0) + let d = scope.getSymbol(sym) + let dict = d.getDictionary + debug "setSymbolFromPath: Found dictionary $# - keys: $#" % [sym, keys.join(".")] + if not dict.isNil: + if keys.len > 1: + return dict.scope.setSymbolFromPath(keys, value, override, define) + else: + return dict.scope.setSymbol(keys[0], value, override, define) + else: + raiseInvalid("Symbol '$1' is not a dictionary." % sym) + +proc getSigil*(scope: ref MinScope, key: string): MinOperator = + if scope.sigils.hasKey(key): + return scope.sigils[key] + elif not scope.parent.isNil: + return scope.parent.getSigil(key) + else: + raiseUndefined("Sigil '$1' not found." % key) + +proc hasSigil*(scope: ref MinScope, key: string): bool = + if scope.isNil: + return false + elif scope.sigils.hasKey(key): + return true + elif not scope.parent.isNil: + return scope.parent.hasSigil(key) + else: + return false + +proc delSigil*(scope: ref MinScope, key: string): bool {.discardable.} = + if scope.sigils.hasKey(key): + if scope.sigils[key].sealed: + raiseInvalid("Sigil '$1' is sealed." % key) + scope.sigils.excl(key) + return true + return false + +proc setSigil*(scope: ref MinScope, key: string, value: MinOperator, + override = false): bool {.discardable.} = + result = false + # check if a sigil already exists in current scope + if not scope.isNil and scope.sigils.hasKey(key): + if not override and scope.sigils[key].sealed: + raiseInvalid("Sigil '$1' is sealed." % key) + scope.sigils[key] = value + result = true + else: + # Go up the scope chain and attempt to find the sigil + if not scope.parent.isNil: + result = scope.parent.setSymbol(key, value) + +proc previous*(scope: ref MinScope): ref MinScope = + if scope.parent.isNil: + return scope + else: + return scope.parent + +proc hasParent*(scope: ref MinScope, parent: ref MinScope): bool = + if scope.parent.isNil: + return false + if scope.parent == parent: + return true + return scope.parent.hasParent parent
D minpkg/core/scope.nim

@@ -1,98 +0,0 @@

-import - std/[strutils, - critbits] -import - parser - -proc copy*(s: ref MinScope): ref MinScope = - var scope = newScope(s.parent) - scope.symbols = s.symbols - scope.sigils = s.sigils - new(result) - result[] = scope - -proc getSymbol*(scope: ref MinScope, key: string, acc = 0): MinOperator = - if scope.symbols.hasKey(key): - return scope.symbols[key] - else: - if scope.parent.isNil: - raiseUndefined("Symbol '$1' not found." % key) - return scope.parent.getSymbol(key, acc + 1) - -proc hasSymbol*(scope: ref MinScope, key: string): bool = - if scope.isNil: - return false - elif scope.symbols.hasKey(key): - return true - elif not scope.parent.isNil: - return scope.parent.hasSymbol(key) - else: - return false - -proc delSymbol*(scope: ref MinScope, key: string): bool {.discardable.} = - if scope.symbols.hasKey(key): - if scope.symbols[key].sealed: - raiseInvalid("Symbol '$1' is sealed." % key) - scope.symbols.excl(key) - return true - return false - -proc setSymbol*(scope: ref MinScope, key: string, value: MinOperator, - override = false): bool {.discardable.} = - result = false - # check if a symbol already exists in current scope - if not scope.isNil and scope.symbols.hasKey(key): - if not override and scope.symbols[key].sealed: - raiseInvalid("Symbol '$1' is sealed ." % key) - scope.symbols[key] = value - result = true - else: - # Go up the scope chain and attempt to find the symbol - if not scope.parent.isNil: - result = scope.parent.setSymbol(key, value, override) - -proc getSigil*(scope: ref MinScope, key: string): MinOperator = - if scope.sigils.hasKey(key): - return scope.sigils[key] - elif not scope.parent.isNil: - return scope.parent.getSigil(key) - else: - raiseUndefined("Sigil '$1' not found." % key) - -proc hasSigil*(scope: ref MinScope, key: string): bool = - if scope.isNil: - return false - elif scope.sigils.hasKey(key): - return true - elif not scope.parent.isNil: - return scope.parent.hasSigil(key) - else: - return false - -proc delSigil*(scope: ref MinScope, key: string): bool {.discardable.} = - if scope.sigils.hasKey(key): - if scope.sigils[key].sealed: - raiseInvalid("Sigil '$1' is sealed." % key) - scope.sigils.excl(key) - return true - return false - -proc setSigil*(scope: ref MinScope, key: string, value: MinOperator, - override = false): bool {.discardable.} = - result = false - # check if a sigil already exists in current scope - if not scope.isNil and scope.sigils.hasKey(key): - if not override and scope.sigils[key].sealed: - raiseInvalid("Sigil '$1' is sealed." % key) - scope.sigils[key] = value - result = true - else: - # Go up the scope chain and attempt to find the sigil - if not scope.parent.isNil: - result = scope.parent.setSymbol(key, value) - -proc previous*(scope: ref MinScope): ref MinScope = - if scope.parent.isNil: - return scope - else: - return scope.parent
M minpkg/core/shell.nimminpkg/core/shell.nim

@@ -3,7 +3,6 @@ import

std/[ strutils, sequtils, - json, critbits, algorithm, streams,

@@ -42,23 +41,14 @@ 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("*") and word.contains("/"): - let dicts = word.substr(1).split("/") + if word.contains("."): var op: MinOperator var dict: MinValue - var path = "*" + var path = "" + if ['?', '@', '\'', '~', '#'].contains(word[0]): + path &= word[0] + word = word[1..^1] + let dicts = word.split(".") for d in dicts: if dict.isNil: if i.scope.symbols.hasKey(d):

@@ -67,27 +57,25 @@ if op.kind == minProcOp and not op.mdl.isNil:

dict = op.mdl elif op.kind == minValOp and op.val.kind == minDictionary: dict = op.val - path &= d & "/" + path &= d & "." elif dict.dVal.hasKey(d): op = dict.dVal[d] if op.kind == minProcOp and not op.mdl.isNil: dict = op.mdl elif op.kind == minValOp and op.val.kind == minDictionary: dict = op.val - path &= d & "/" + path &= d & "." return dict.dVal.keys.toSeq.mapIt(path & it) - if word.startsWith("*"): - let filterProc = proc (it: string): bool = - let op = i.scope.symbols[it] - if op.kind == minProcOp and not op.mdl.isNil: - return true - else: - return op.kind == minValOp and op.val.kind == minDictionary - return symbols.filter(filterProc).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 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(envPairs()).mapIt("$" & $it[0]) if word.startsWith("\""):

@@ -99,7 +87,8 @@ 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("\\", "/")]) + return toSeq(walkDir(f, true)).mapIt("\"$1$2\"" % [f, it.path.replace( + "\\", "/")]) else: var dir: string if f.contains("/") or dir.contains("\\"):

@@ -116,7 +105,7 @@ it.path.replace("\\", "/")])

return symbols proc p(s: string, color = fgWhite) = - if SIMPLEREPL: + if SIMPLEREPL or not COLOR: stdout.write(s) else: stdout.styledWrite(color, s)
M minpkg/core/stdlib.nimminpkg/core/stdlib.nim

@@ -34,7 +34,6 @@ var customPrelude* {.threadvar.}: string

customPrelude = "" proc stdLib*(i: In) = - setLogFilter(logging.lvlNotice) if not MINSYMBOLS.fileExists: MINSYMBOLS.writeFile("{}") if not MINHISTORY.fileExists:
M minpkg/core/utils.nimminpkg/core/utils.nim

@@ -6,7 +6,6 @@ baseutils,

parser, value, json, - scope, env, interpreter

@@ -248,6 +247,7 @@ return true

else: let tc = "typeclass:$#" % t let ta = "typealias:$#" % t + let taSym = i.scope.getSymbol(ta) if t.contains(":"): var split = t.split(":") # Typed dictionaries

@@ -255,11 +255,11 @@ if split[0] == "dict":

if value.isTypedDictionary(split[1]): return true return false - elif i.scope.hasSymbol(ta): + elif not taSym.isNull: # Custom type alias - let element = i.scope.getSymbol(ta).val.getString + let element = taSym.val.getString return i.validateValueType(element, value) - elif i.scope.hasSymbol(tc): + elif not i.scope.getSymbol(tc).isNull: # Custom type class var i2 = i.copy(i.filename) i2.withScope():

@@ -292,7 +292,7 @@ const ts = ["bool", "null", "int", "num", "flt", "quot", "dict", "'sym",

"sym", "str", "a"] if ts.contains(s): return true - if i.scope.hasSymbol("typeclass:$#" % s): + if not i.scope.getSymbol("typeclass:$#" % s).isNull: return true for ta in s.split("|"): for to in ta.split("&"):

@@ -302,10 +302,11 @@ return false

if to[0] == '!': tt = to[1..to.len-1] if not ts.contains(tt) and not tt.startsWith("dict:") and - not i.scope.hasSymbol("typeclass:$#" % tt): + i.scope.getSymbol("typeclass:$#" % tt).isNull: let ta = "typealias:$#" % tt - if i.scope.hasSymbol(ta): - return i.validType(i.scope.getSymbol(ta).val.getString) + let taSym = i.scope.getSymbol(ta) + if not taSym.isNull: + return i.validType(taSym.val.getString) return false return true
M minpkg/lib/min_dict.nimminpkg/lib/min_dict.nim

@@ -91,10 +91,4 @@ def.symbol("dtype") do (i: In):

let vals = i.expect("dict") i.push vals[0].objType.newVal - def.sigil("/") do (i: In): - i.pushSym("dget") - - def.sigil("%") do (i: In): - i.pushSym("dset") - def.finalize("dict")
M minpkg/lib/min_global.nimminpkg/lib/min_global.nim

@@ -19,8 +19,7 @@ ../core/meta,

../core/parser, ../core/value, ../core/interpreter, - ../core/utils, - ../core/scope + ../core/utils proc processTokenValue(v: string, t: MinTokenKind): string = case t:

@@ -36,6 +35,8 @@ of tkBlockDocComment:

return "#||$#||#" % [v] of tkBlockComment: return "#|$#|#" % [v] + of tkCommand: + return "[$#]" % [v] else: return v

@@ -161,7 +162,11 @@ 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 + # We need to set the mdl field of minOperators + # In case of modules, or internal calls will not work + var v = value + v.mdl = mdl + mdl.scope.symbols[key] = v i.push(mdl) else: if not f.fileExists:

@@ -417,7 +422,7 @@ i.push q.newVal

def.symbol("defined-symbol?") do (i: In): let vals = i.expect("'sym") - i.push(i.scope.hasSymbol(vals[0].getString).newVal) + i.push((not i.scope.getSymbol(vals[0].getString).isNull).newVal) def.symbol("defined-sigil?") do (i: In): let vals = i.expect("'sym")

@@ -504,16 +509,13 @@ let vals = i.expect("'sym", "a")

let sym = vals[0] var q1 = vals[1] # existing (auto-quoted) var symbol: string - var isQuot = q1.isQuotation q1 = @[q1].newVal symbol = sym.getString - if not symbol.contains re(USER_SYMBOL_REGEX): + if not symbol.contains re(USER_PATH_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]) - i.scope.symbols[symbol] = MinOperator(kind: minValOp, val: q1, - sealed: false, quotation: isQuot) + i.scope.setSymbol(symbol, MinOperator(kind: minValOp, val: q1, + sealed: false, quotation: q1.isQuotation), false, true) def.symbol("typealias") do (i: In): let vals = i.expect("'sym", "'sym")

@@ -610,15 +612,15 @@

def.symbol("symbol-help") do (i: In): let vals = i.expect("'sym") let s = vals[0].getString - if i.scope.hasSymbol(s): - let sym = i.scope.getSymbol(s) + let sym = i.scope.getSymbol(s) + if not sym.isNull: if not sym.doc.isNil and sym.doc.kind == JObject: var doc = i.fromJson(sym.doc) doc.objType = "help" i.push doc return - elif HELP["operators"].hasKey(s): - var doc = i.fromJson(HELP["operators"][s]) + elif HELP["symbols"].hasKey(s): + var doc = i.fromJson(HELP["symbols"][s]) doc.objType = "help" i.push doc return

@@ -634,8 +636,8 @@ var doc = i.fromJson(sym.doc)

doc.objType = "help" i.push doc return - elif HELP["operators"].hasKey(s): - var doc = i.fromJson(HELP["operators"][s]) + elif HELP["symbols"].hasKey(s): + var doc = i.fromJson(HELP["symbols"][s]) doc.objType = "help" i.push doc return

@@ -645,11 +647,14 @@ def.symbol("help") do (i: In):

if i.stack.len == 0 or not i.stack[i.stack.len-1].isStringLike: warn "Specify a quoted symbol or string to show its help documentation, e.g. 'puts help" return - let s = i.pop.getString + var s = i.pop.getString var found = false var foundDoc = false let displayDoc = proc (j: JsonNode) = - echo "=== $# [$#]" % [j["name"].getStr, j["kind"].getStr] + if j.hasKey("module"): + echo "=== $#.$# [$#]" % [j["module"].getStr, j["name"].getStr, j["kind"].getStr] + else: + echo "=== $# [$#]" % [j["name"].getStr, j["kind"].getStr] if j.hasKey("signature"): echo j["signature"].getStr if j.hasKey("description"):

@@ -660,15 +665,22 @@ echo ""

for l in lines: echo " " & l echo "===" - if i.scope.hasSymbol(s): + let sym = i.scope.getSymbol(s) + if not sym.isNull: found = true - let sym = i.scope.getSymbol(s) if not sym.doc.isNil and sym.doc.kind == JObject: foundDoc = true displayDoc(sym.doc) - elif HELP["operators"].hasKey(s): + return + var mdl = "" + if s.contains('.'): + let parts = s.split(".") + mdl = parts[0] + s = parts[1] + if HELP["symbols"].hasKey(s) and (mdl == "" or mdl == HELP["symbols"][ + s]["module"].getStr): foundDoc = true - displayDoc HELP["operators"][s] + displayDoc HELP["symbols"][s] if i.scope.hasSigil(s): found = true let sym = i.scope.getSigil(s)

@@ -1134,7 +1146,7 @@ else:

raiseInvalid("Cannot convert a quotation to float.") def.symbol("prompt") do (i: In): - i.eval(""""[$1]\n$$ " (.) => %""") + i.eval(""""[$1]\n$$ " (pwd) => %""") def.symbol("quotesym") do (i: In): let vals = i.expect("str")

@@ -1166,6 +1178,20 @@ i.dset(dict, "value", p.a.processTokenValue(t).newVal)

q.add dict i.push q.newVal + def.symbol("get-env") do (i: In): + let vals = i.expect("'sym") + let a = vals[0] + i.push a.getString.getEnv.newVal + + def.symbol("put-env") do (i: In): + let vals = i.expect("'sym", "'sym") + let key = vals[0] + let value = vals[1] + key.getString.putEnv value.getString + + def.symbol("$") do (i: In): + i.pushSym("get-env") + # Sigils def.sigil("'") do (i: In):

@@ -1183,17 +1209,14 @@

def.sigil("*") do (i: In): i.pushSym("invoke") - def.sigil(">") do (i: In): - i.pushSym("save-symbol") - - def.sigil("<") do (i: In): - i.pushSym("load-symbol") - def.sigil("^") do (i: In): i.pushSym("lambda") def.sigil("~") do (i: In): i.pushSym("lambda-bind") + + def.sigil("$") do (i: In): + i.pushSym("get-env") # Shorthand symbol aliases
M minpkg/lib/min_io.nimminpkg/lib/min_io.nim

@@ -46,6 +46,10 @@ let action = proc (ed: var LineEditor) {.closure.} =

ic.apply(q) KEYMAP[key] = action + def.symbol("color") do (i: In): + let vals = i.expect("bool") + COLOR = vals[0].boolVal + def.symbol("newline") do (i: In): echo ""
M minpkg/lib/min_logic.nimminpkg/lib/min_logic.nim

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

import - std/math + std/[math, strutils] import ../core/parser, ../core/value,

@@ -133,7 +133,7 @@ i.dequote vv

let r = i.pop c.inc() if not r.isBool: - raiseInvalid("Quotation #$# does not evaluate to a boolean value") + raiseInvalid("Quotation #$# does not evaluate to a boolean value" % [$c]) if not r.boolVal: i.push r return

@@ -157,7 +157,7 @@ i.dequote vv

let r = i.pop c.inc() if not r.isBool: - raiseInvalid("Quotation #$# does not evaluate to a boolean value") + raiseInvalid("Quotation #$# does not evaluate to a boolean value" % [$c]) if r.boolVal: i.push r return
M minpkg/lib/min_sys.nimminpkg/lib/min_sys.nim

@@ -17,10 +17,10 @@

proc sys_module*(i: In) = let def = i.define() - def.symbol(".") do (i: In): + def.symbol("pwd") do (i: In): i.push newVal(getCurrentDir().unix) - def.symbol("..") do (i: In): + def.symbol("parent-dir") do (i: In): i.push newVal(getCurrentDir().parentDir.unix) def.symbol("cd") do (i: In):

@@ -59,17 +59,6 @@ var d = newDict(i.scope)

i.dset(d, "output", res.output.strip.newVal) i.dset(d, "code", res.exitCode.newVal) i.push(d) - - def.symbol("get-env") do (i: In): - let vals = i.expect("'sym") - let a = vals[0] - i.push a.getString.getEnv.newVal - - def.symbol("put-env") do (i: In): - let vals = i.expect("'sym", "'sym") - let key = vals[0] - let value = vals[1] - key.getString.putEnv value.getString def.symbol("env?") do (i: In): let vals = i.expect("'sym")

@@ -154,24 +143,6 @@ let vals = i.expect("'sym", "'sym")

let dest = vals[0] let src = vals[1] src.getString.createHardlink dest.getString - - def.symbol("$") do (i: In): - i.pushSym("get-env") - - def.symbol("!") do (i: In): - i.pushSym("system") - - def.symbol("&") do (i: In): - i.pushSym("run") - - def.sigil("$") do (i: In): - i.pushSym("get-env") - - def.sigil("!") do (i: In): - i.pushSym("system") - - def.sigil("&") do (i: In): - i.pushSym("run") def.symbol("unzip") do (i: In): let vals = i.expect("'sym", "'sym")
M minpkg/lib/min_xml.nimminpkg/lib/min_xml.nim

@@ -3,6 +3,7 @@ import

std/[xmlparser, xmltree, parsexml, + htmlparser, strtabs, critbits] import

@@ -92,6 +93,16 @@ except CatchableError:

let msg = getCurrentExceptionMsg() raiseInvalid(msg) + def.symbol("from-html") do (i: In): + let vals = i.expect("str") + let s = vals[0].getString() + try: + let xml = parseHtml(s) + i.push(i.newXDict(xml)) + except CatchableError: + let msg = getCurrentExceptionMsg() + raiseInvalid(msg) + def.symbol("xcomment") do (i: In): let vals = i.expect("'sym") i.push i.newXDict(newComment(vals[0].getString))

@@ -107,6 +118,17 @@

def.symbol("xentity") do (i: In): let vals = i.expect("'sym") i.push i.newXDict(newEntity(vals[0].getString)) + + def.symbol("xentity2utf8") do (i: In): + let vals = i.expect("dict:xml-entity") + var entity = i.dget(vals[0], "text").getString + # Strip & and ; + entity = entity[1..entity.len-2] + i.push entity.entityToUtf8.newVal + + def.symbol("xescape") do (i: In): + let vals = i.expect("'sym") + i.push vals[0].getString.escape.newVal def.symbol("xelement") do (i: In): let vals = i.expect("'sym")
M next-release.mdnext-release.md

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

+### BREAKING CHANGES + +- User-defined symbols can no longer contain dots (`.`). +- The symbol `invoke` and the `*` sigil have been removed in favor of symbol dot notation. +- The `.` and `..` symbols have been renamed to `pwd` and `parent-dir` respectively. +- The `!` symbol has been removed; use `system` instead. +- The `!` sigil has been removed; use `system` instead. +- The `&` symbol has been removed; use `run` instead. +- The `&` sigil has been removed; use `run` instead. +- The `/` sigil has been removed; use `dget` or symbol dot notation instead. +- The `%` sigil has been removed; use `dset` or symbol dot notation instead. +- The `>` sigil has been removed; use `save-symbol` innstead. +- The `<` sigil has been removed; use `load-symbol` innstead. +- Moved `get-env`, `put-env`, `$` symbol and `$` sigil from `sys` to `global` module. + +### New Features + +- It is now possible to access dictionary (and module) keys (even nested) via dot notation. This replaces the `invoke` symbol. +- Added shell auto-completion for symbols using dot notation +- Added a new `color` symbol to the `io` module to enable/disable terminal color output. +- Added a new `from-html` symbol to the `xml` module to parse HTML documents and fragments. +- Added a new `xentity2utf8` symbol to the `xml` module to convert an XML entity to its corresponding UTF-8 string. +- Added a new `xescape` symbol to the `xml` module to convert special XML characters into the corresponding XML entities. + ### Fixes and Improvements -- Upgraded OpenSSL to version 3.3.0. -- Nimble metadata are now specified statically in the `min.nimble` file (Fixes #193). -- Minor documentation fixes. +- Fixed `tokenize` symbol (wasn't processing commands correctly)
M site/contents/learn-extending.mdsite/contents/learn-extending.md

@@ -30,7 +30,7 @@

``` 'quickpows require :qp -2 *qp/pow3 *qp/pow2 puts ;prints 64 +2 qp.pow3 qp.pow2 puts ;prints 64 ``` ## Specifying your custom prelude program
M site/contents/learn-operators.mdsite/contents/learn-operators.md

@@ -14,10 +14,12 @@ There are two types of operators: _symbols_ and _sigils_.

## Symbols -_Symbols_ are the most common type of operator. A min symbol is a single word that is either provided by one of the predefined min {#link-page||reference||modules#} like `dup` or `.` or defined by the user. User-defined symbols must: +_Symbols_ are the most common type of operator. A min symbol is a single word that is either provided by one of the predefined min {#link-page||reference||modules#} like `dup` or `pwd` or defined by the user. User-defined symbols must: * Start with a letter or an underscore (\_). -* Contain zero or more letters, numbers and/or any of the following characters: `/ ! ? + * . _ -` +* Contain zero or more letters, numbers and/or any of the following characters: `/ ! ? + * _ -` + +If a symbol contains a dot (`.`) then it is namespaced by its containing module or dictionary. For example, `fs.dirname` identifies the {{#link-operator||fs||dirname}} operator defined in the {{#link-module||fs}} module. It is possible to define operator symbols using the {#link-operator||global||operator#} symbol. The following min program defines a new symbol called square that duplicates the first element on the stack and multiplies the two elements:

@@ -71,8 +73,6 @@ '

: Alias for {#link-operator||global||quote#}. \: : Alias for {#link-operator||global||define#}. -* -: Alias for {#link-operator||global||invoke#}. @ : Alias for {#link-operator||global||bind#}. ^

@@ -114,7 +114,7 @@ ) operator

This definition will add a `j` sigil that will process the following string as JSON code, so for example: - j"{\"test\": true}" + j"{\\"test\\": true}" ...will push the following dictionary on the stack:

@@ -323,8 +323,8 @@ constructor point

(num :x num :y ==> dict :out) ( {} - x %x - y %y + x 'x dset + y 'y dset @out ) ) ::
A site/contents/news/v0.44.0.md

@@ -0,0 +1,54 @@

+----- +content-type: "post" +title: "Version 0.44.0 released" +slug: v0.44.0 +date: 2024-06-18 +----- +{@ _defs_.md || 0 @} + +This minor release brings a lot of refactoring and a few breaking changes related to sigils and introduces a new concept of _dot notation_ for symbols. + +In previous releases, it was possible to use the `invoke` symbol (and the `*` sigil) to access members of a dictionary or modules, e.g. `*crypto/encode` to access the {#link-operator||crypto||encode#} symbol of the {#link-module||crypto#} module. This was fine, but a little bit verbose... plus this didn't work for setting values, for example. + +As of this release, you can no longer use `.` in symbols, because that will be used as a namespace separator, so you'll be able to do things like this: + +``` +{} :example +(dup *) :example.square +(dup dup * *) :example.cube + +2 example.square example.cube puts! # Prints 64 +``` + +> %tip% +> Tip +> +> You can run `min run min-upgrade <folder>` to automatically upgrade all the `.min` files in `<folder>` and all its subfolders. + +### BREAKING CHANGES + +- User-defined symbols can no longer contain dots (`.`). +- The symbol `invoke` and the `*` sigil have been removed in favor of symbol dot notation. +- The `.` and `..` symbols have been renamed to `pwd` and `parent-dir` respectively. +- The `!` symbol has been removed; use `system` instead. +- The `!` sigil has been removed; use `system` instead. +- The `&` symbol has been removed; use `run` instead. +- The `&` sigil has been removed; use `run` instead. +- The `/` sigil has been removed; use `dget` or symbol dot notation instead. +- The `%` sigil has been removed; use `dset` or symbol dot notation instead. +- The `>` sigil has been removed; use `save-symbol` innstead. +- The `<` sigil has been removed; use `load-symbol` innstead. +- Moved `get-env`, `put-env`, `$` symbol and `$` sigil from `sys` to `global` module. + +### New Features + +- It is now possible to access dictionary (and module) keys (even nested) via dot notation. This replaces the `invoke` symbol. +- Added shell auto-completion for symbols using dot notation +- Added a new `color` symbol to the `io` module to enable/disable terminal color output. +- Added a new `from-html` symbol to the `xml` module to parse HTML documents and fragments. +- Added a new `xentity2utf8` symbol to the `xml` module to convert an XML entity to its corresponding UTF-8 string. +- Added a new `xescape` symbol to the `xml` module to convert special XML characters into the corresponding XML entities. + +### Fixes and Improvements + +- Fixed `tokenize` symbol (wasn't processing commands correctly)
M site/contents/reference-dict.mdsite/contents/reference-dict.md

@@ -4,10 +4,6 @@ title: "dict Module"

----- {@ _defs_.md || 0 @} -{#sig||/||dget#} - -{#sig||%||dset#} - {#op||ddup||{{d1}}||{{d2}}|| Returns a copy of {{d1}}. #}
M site/contents/reference-dstore.mdsite/contents/reference-dstore.md

@@ -31,7 +31,7 @@ > > Example

> > > > Assuming that **ds** is a datastore, the following program retrieves all elements of teh collection **posts** whose author field is set to "h3rald": > > -> > ds "posts" (/author "h3rald" ==) dsquery +> > ds "posts" ('author dget "h3rald" ==) dsquery #} {#op||dsread||{{sl}}||{{dstore}}||
M site/contents/reference-global.mdsite/contents/reference-global.md

@@ -22,15 +22,13 @@ {#sig||~||lambda-bind#}

{#alias||~||lambda-bind#} -{#sig||&ast;||invoke#} +{#sig||$||get-env#} + +{#alias||$||get-env#} {#sig||@||bind#} {#alias||@||bind#} - -{#sig||&gt;||save-symbol#} - -{#sig||&lt;||load-symbol#} {#alias||->||dequote#}

@@ -102,10 +100,10 @@ {#op||defined-sigil?||{{sl}}||{{b}}||

Returns {{t}} if the symbol {{sl}} is defined, {{f}} otherwise.#} {#op||delete-sigil||{{sl}}||{{none}}|| -Deletes the specified symbol {{sl}}.#} +Deletes the specified user-defined sigil {{sl}}.#} -{#op||delete-sigil||{{sl}}||{{none}}|| -Deletes the specified user-defined sigil {{sl}}.#} +{#op||delete-symbol||{{sl}}||{{none}}|| +Deletes the specified symbol {{sl}}.#} {#op||dequote||{{q}}||{{a0p}}|| > Pushes the contents of quotation {{q}} on the stack.

@@ -189,6 +187,9 @@

{#op||gets||{{none}}||{{s}}|| Reads a line from STDIN and places it on top of the stack as a string.#} +{#op||get-env||{{sl}}||{{s}}|| +Returns environment variable {{sl}}. #} + {#op||help||{{sl}}||{{none}}|| Prints the help text for {{sl}}, if available. #}

@@ -224,17 +225,6 @@ > * If {{any}} is {{null}}, it is converted to `0`.

> * If {{any}} is an integer, no conversion is performed. > * If {{any}} is a float, it is converted to an integer value by truncating its decimal part. > * If {{any}} is a string, it is parsed as an integer value.#} - -{#op||invoke||{{sl}}||{{a0p}}|| -> Assuming that {{sl}} is a formatted like *dictionary*/*symbol*, calls *symbol* defined in *dictionary* (note that this also works for nested dictionaries. -> -> > %sidebar% -> > Example -> > -> > The following program leaves `100` on the stack: -> > -> > {{100 :b} :a} :test *test/a/b - #} {#op||lambda||{{q}} {{sl}}||{{none}}|| > Defines a new symbol {{sl}}, containing the specified quotation {{q}}. Unlike with `define`, in this case {{q}} will not be quoted, so its values will be pushed on the stack when the symbol {{sl}} is pushed on the stack.

@@ -370,6 +360,9 @@

{#op||puts||{{any}}||{{any}}|| Prints {{any}} and a new line to STDOUT.#} +{#op||put-env||{{sl1}} {{sl2}}||{{s}}|| +Sets environment variable {{sl2}} to {{sl1}}. #} + {#op||quit||{{none}}||{{none}}|| Exits the program or shell with 0 as return code. #}

@@ -478,8 +471,8 @@ > >

> > The following program: > > > > {1 :a 2 :b 3 :c} ( -> > (dup /a succ succ %a) -> > (dup /b succ %b) +> > (dup 'a dget succ succ 'a dset) +> > (dup 'b dget succ 'b dset) > > ) tap > > > > Returns `{3 :a 3 :b 3 :c}`.#}
M site/contents/reference-http.mdsite/contents/reference-http.md

@@ -19,8 +19,8 @@ > >

> > The following code constructs {{d}} and passes it to the **request** operator to perform an HTTP GET request to <http://httpbin.org/ip>: > > > > {} -> > "GET" %method -> > "http://httpbin.org/ip" %url +> > "GET" 'method dget +> > "http://httpbin.org/ip" 'url dset > > request #}

@@ -63,7 +63,7 @@ > > ((true) ("Invalid Request: $1" url quote %))

> > ) case > > :body > > ; Prepare the response -> > {} body %body +> > {} body 'body dset > > dup puts! > > ) > > ; The request handler is ready, give it the name handler

@@ -71,8 +71,8 @@ > > :handler

> > > > ; Create the parameter dictionary for the server > > {} -> > handler %handler -> > 5555 %port +> > handler 'handler dset +> > 5555 'port dset > > > > ; Start server > > "Server started on port 5555." puts!
M site/contents/reference-io.mdsite/contents/reference-io.md

@@ -14,6 +14,9 @@ > If the user enters a number that matches one of the choices, then the corresponding quotation {{q1}} is executed, otherwise the choice menu is displayed again until a valid choice is made. #}

{#op||clear||{{none}}||{{none}}|| Clears the screen.#} + +{#op||color||{{b}}||{{none}}|| +Enables or disabled color output in terminal (enabled by default).#} {#op||column-print||{{q}} {{i}}||{{any}}|| Prints all elements of {{q}} to STDOUT, in {{i}} columns.#}
M site/contents/reference-sys.mdsite/contents/reference-sys.md

@@ -4,24 +4,6 @@ title: "sys Module"

----- {@ _defs_.md || 0 @} -{#sig||$||get-env#} - -{#alias||$||get-env#} - -{#sig||&excl;||system#} - -{#alias||&excl;||system#} - -{#sig||&||run#} - -{#alias||&||run#} - -{#op||.||{{none}}||{{s}}|| -Returns the full path to the current directory. #} - -{#op||..||{{none}}||{{s}}|| -Returns the full path to the parent directory. #} - {#op||admin?||{{none}}||{{b}}|| Returns {{t}} if the program is being run with administrative privileges. #}

@@ -33,7 +15,7 @@ > > Example

> > > > 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: > > -> > `/tmp/test.txt 755 chmod`#} +> > `"/tmp/test.txt 755 chmod"`#} {#op||cd||{{sl}}||{{none}}|| Change the current directory to {{sl}}. #}

@@ -46,9 +28,6 @@ Returns the host CPU. It can be one of the following strings i386, alpha, powerpc, powerpc64, powerpc64el, sparc, amd64, mips, mipsel, arm, arm64. #}

{#op||env?||{{sl}}||{{b}}|| Returns {{t}} if environment variable {{sl}} exists, {{f}} otherwise. #} - -{#op||get-env||{{sl}}||{{s}}|| -Returns environment variable {{sl}}. #} {#op||hardlink||{{sl1}} {{sl2}}||{{none}}|| Creates hardlink {{sl2}} for file or directory {{sl1}}. #}

@@ -68,8 +47,11 @@

{#op||os||{{none}}||{{s}}|| Returns the host operating system. It can be one of the following strings: windows, macosx, linux, netbsd, freebsd, openbsd, solaris, aix, standalone. #} -{#op||put-env||{{sl1}} {{sl2}}||{{s}}|| -Sets environment variable {{sl2}} to {{sl1}}. #} +{#op||parent-dir||{{none}}||{{s}}|| +Returns the full path to the parent directory. #} + +{#op||pwd||{{none}}||{{s}}|| +Returns the full path to the current directory. #} {#op||rm||{{sl}}||{{none}}|| Deletes the specified file {{sl}}. #}
M site/contents/reference-xml.mdsite/contents/reference-xml.md

@@ -4,8 +4,11 @@ title: "xml Module"

----- {@ _defs_.md || 0 @} +{#op||from-html||{{sl}}||{{xnode}}|| +Returns an {{xnode}} representing an HTML string (wrapped in a `<document>` tag unless a valid HTML document is provided as input).#} + {#op||from-xml||{{sl}}||{{xnode}}|| -> Returns an {{xnode}} representing an XML string representing an element or fragment. +> Returns an {{xnode}} representing an XML string (element or fragment). > > > %sidebar% > > Example

@@ -37,6 +40,20 @@ Returns a {{xelement}} representing an XML element (it will be an empty element with no attributes or children). #}

{#op||xentity||{{sl}}||{{xentity}}|| Returns a {{xentity}} representing an XML entity. #} + +{#op||xescape||{{sl}}||{{s}}|| +Converts any `<`, `>`, `&`, `'`, and `"` present in {{sl}} into the corresponding XML entities. #} + +{#op||xentity2utf8||{{xentity}}||{{s}}|| +> Returns the UTF-8 symbol corresponding to the specified XML entity. +> +> > %sidebar% +> > Example +> > +> > The following program prints `p` to the screen: +> > +> > "&gt;" xentity xentity2utf8 puts + #} {#op||xquery||{{xelement}} {{sl}}||{{xelement}}|| > Returns an {{xelement}} representing the first element matching CSS the selector {{sl}}.
M site/contents/reference.mdsite/contents/reference.md

@@ -23,7 +23,7 @@ : Provides operators for accessing file information and properties.

{#link-module||logic#} : Provides comparison operators for all min data types and other boolean logic operators. {#link-module||str#} -: Provides operators to perform operations on strings, use regular expressions, interpolation, etc.. +: Provides operators to perform operations on strings, use regular expressions, interpolation, etc. {#link-module||sys#} : Provides operators to use as basic shell commands, access environment variables, and execute external commands. {#link-module||num#}
M site/rules.minsite/rules.min

@@ -11,19 +11,19 @@ (

symbol set-destination (dict :meta ==> dict :result) ( - meta /id :id - meta /ext :ext + meta "id" dget :id + meta "ext" dget :ext ( ((id "home" ==) ( meta ( - ("index" %id) - (".html" %ext) + ("index" "id" dset) + (".html" "ext" dset) ) tap )) ((ext ".md" ==) ( meta ( - (".html" %ext) - ("$1/index" (id) => % %id) + (".html" "ext" dset) + ("$1/index" (id) => % "id" dset) ) tap )) ) case

@@ -31,6 +31,22 @@ @result

) ) :: + +( + symbol convert-html-entities + (str :content ==> str :result) + ( + content "&[^;]+;" + ( + 0 get :entity + (("&lt;" "&gt;" "&amp;" "&apos;" "&quot;") entity in? not) + (entity xentity xentity2utf8 @entity) + when + entity + ) replace-apply @result + ) +) :: + ;Processing operators ( symbol process-md-with-template

@@ -40,24 +56,24 @@ "" :page

"" :contents meta ( (input-fread @contents meta) - (settings /title %site) - (settings /version %version) + (settings "title" dget "site" dset) + (settings "version" dget "version" dset) ( :temp contents temp markdown highlight-codeblocks highlight-codes @contents temp ) - (contents %contents) + (contents "contents" dset) ( ; Save post content (plain HTML fragment, no template) :temp - (temp /content-type "post" ==) + (temp "content-type" dget "post" ==) ; Need to save html fragment separately because contents is overwritten. - (temp dup /contents %fragment posts append @posts) + (temp dup "contents" dget convert-html-entities "fragment" dset posts append @posts) when temp ) (:temp tpl temp mustache @page temp) - (page %contents) + (page "contents" dset) ) tap @result ) ) ::

@@ -66,7 +82,7 @@ (

symbol process-md-content (dict :meta ==> dict :result) ( - meta /content-type :ct + meta "content-type" dget :ct meta ct process-md-with-template @result )

@@ -76,8 +92,8 @@ (

symbol process-content (dict :meta ==> dict :result) ( - meta /ext :ext - meta /id :id + meta "ext" dget :ext + meta "id" dget :id meta ( ((".md" ext ==) (process-md-content))

@@ -94,7 +110,7 @@ "" :contents

meta ( (input-fread @contents meta) (:temp contents preprocess-css @contents temp) - (contents %contents) + (contents "contents" dset) ) tap output-fwrite )

@@ -107,10 +123,10 @@ (

timestamp :ts data input-fread from-json :contents ; Save modules - contents /modules @modules + contents "modules" dget @modules ; Update timestamp - contents ts %updated @contents - data contents to-json %contents + contents ts "updated" dset @contents + data contents to-json "contents" dset output-fwrite ; Add timesyamp file {

@@ -119,7 +135,7 @@ "mmm" :id

".timestamp" :ext "asset" :type } - ts string %contents + ts string "contents" dset output-fwrite ) ) ::

@@ -129,7 +145,7 @@ symbol download-latest-min-exes

(==>) ( "Downloading latest min executables..." notice! - settings /version :version + settings "version" dget :version ("windows" "macosx" "linux") ( :opsys

@@ -157,7 +173,7 @@

contents ( (dict) expect -> :meta ( - ((meta /id "^_" match?) ()) ;Ignore files starting with underscore. + ((meta "id" dget "^_" match?) ()) ;Ignore files starting with underscore. ((true) (meta process-content set-destination output-fwrite)) ) case ) foreach

@@ -166,8 +182,8 @@ "Processing assets..." notice!

assets ( (dict) expect -> :meta ( - ((meta /ext ".css" ==) (meta process-css-asset)) - ((meta /path "mmm.json" ==) (meta process-mmm-json)) + ((meta "ext" dget ".css" ==) (meta process-css-asset)) + ((meta "path" dget "mmm.json" ==) (meta process-mmm-json)) ((true) (meta output-cp)) ) case ) foreach

@@ -176,57 +192,54 @@ "Generating mmm index..." notice!

; Process deps of each module -> name@version modules ( :module - module /deps dkeys ( + module "deps" dget dkeys ( :name - module /deps name dget :version + module "deps" dget name dget :version "$#@$#" (name version) =% ) map ", " join :dependencies (dependencies "" ==) ("n/a" @dependencies) when - module dependencies %dependencies + module dependencies "dependencies" dset ) map @modules {} - "mmm/index" %id - "mmm.html" %path - ".html" %ext - "mmm" %title - "min language" %site - "page" %content-type - modules %modules + "mmm/index" "id" dset + "mmm.html" "path" dset + ".html" "ext" dset + "mmm" "title" dset + "min language" "site" dset + "page" "content-type" dset + modules "modules" dset dup -"mmm" swap mustache %contents output-fwrite +"mmm" swap mustache "contents" dset output-fwrite "Generating news page..." notice! ; Get news -;contents -; (:content ((content 'content-type dhas?) (content /content-type "post" ==)) &&) -;filter posts - (:a :b a /date b /date >) + (:a :b a "date" dget b "date" dget >) sort @posts {} - "news/index" %id - "news.html" %path - ".html" %ext - "News" %title - "min language" %site - "page" %content-type - posts %posts + "news/index" "id" dset + "news.html" "path" dset + ".html" "ext" dset + "News" "title" dset + "min language" "site" dset + "page" "content-type" dset + posts "posts" dset dup -"news" swap mustache %contents output-fwrite +"news" swap mustache "contents" dset output-fwrite {} - "rss" %id - "rss.xml" %path - ".xml" %ext - "min programming language" %title - "min language" %site - "rss" %content-type - posts %posts + "rss" "id" dset + "rss.xml" "path" dset + ".xml" "ext" dset + "min programming language" "title" dset + "min language" "site" dset + "rss" "content-type" dset + posts "posts" dset dup -"rss" swap mustache %contents output-fwrite +"rss" swap mustache "contents" dset output-fwrite
M site/settings.jsonsite/settings.json

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

"temp": "temp", "templates": "templates", "title": "min language", - "version": "0.43.1" + "version": "0.44.0" }
M tasks/build.mintasks/build.min

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

-#!/usr/bin/env min "_helpers" require :helpers 'helpers import ( symbol cz ('sym :stage 'sym :variant 'sym :target-os ==>) ( true :pack-result (stage "^(release-nopack|dev)$" match?) (false @pack-result) when "-d:release" :d-stage (stage "dev" ==) ("-d:dev" @d-stage) when " " :d-variant "min" :o-variant (variant length 0 >) ( "-d:$# " (variant) =% @d-variant "$#min" (variant) =% @o-variant ) when "nim" required "Building $# - $# (x64)" (o-variant target-os) =% notice! "" :musl "musl-gcc" which :musl-gcc (musl-gcc length 0 >) ("--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc" @musl) when "nim c $# -d:ssl -d:useOpenSsl3 $# --opt:size --cpu:amd64 --os:$# $#-o:$# min" (d-stage musl target-os d-variant o-variant) =% puts ! pop (pack-result) ( {} target-os %os config /version %version o-variant %exe pack ) when ) ) :: ;; Builds and packs a min executable. #| Tasks |# ( symbol guide (==>) ( "hastyscribe" required "Building - guide" notice! "hastyscribe Min_DeveloperGuide.md --field/version=$#" (version) =% !! "cp Min_DeveloperGuide.htm site/output/guide.dev.html" !! ) ) :: ;; Builds the developer guide. ( symbol site (==>) ( "hastysite" required "Building - site" notice! "cd site && hastysite build && cd .." !! ) ) :: ;; Builds the min site. ( symbol pack (dict :vdata ==>) ( vdata /exe :exe (vdata /os "windows" ==) ("$#.exe" (exe) =% @exe) when "$exe:_v$version:_$os:_x64.zip" :fn fn vdata dpairs % ":" "" replace @fn "Compressing: $#" (fn) =% notice! (exe) => fn zip ) ) :: ;; Compresses a min executable. ( symbol vim (==>) ( config /version :min-version "tasks/data/min.vim" fread :template timestamp "dd MMM YYYY" tformat :date min-symbols ("||" !=) filter " " join :symbols "min.vim" :out-file "Building - min.vim" notice! template ("date" date "version" min-version "symbols" symbols) =% out-file fwrite ) ) :: ;; Generates the min.vim file. ( symbol docs (==>) ( guide site ) ) :: ;; Generate the min development guide and site. ( symbol dev (==>) ("dev" "" os cz) ) :: ;; Builds min (dev version) on the current OS. ( symbol default (==>) ("release-nopack" "" os cz) ) :: ;; Builds min on the current OS. ( symbol linux (==>) ("" "" "linux" cz) ) :: ;; Builds min for Linux. ( symbol macosx (==>) ("" "" "macosx" cz) ) :: ;; Builds min for macOS. ( symbol windows (==>) ("" "" "windows" cz) ) :: ;; Builds min for Windows. +#!/usr/bin/env min "_helpers" require :helpers 'helpers import ( symbol cz ('sym :stage 'sym :variant 'sym :target-os ==>) ( true :pack-result (stage "^(release-nopack|dev)$" match?) (false @pack-result) when "-d:release" :d-stage (stage "dev" ==) ("-d:dev" @d-stage) when " " :d-variant "min" :o-variant (variant length 0 >) ( "-d:$# " (variant) =% @d-variant "$#min" (variant) =% @o-variant ) when "nim" required "Building $# - $# (x64)" (o-variant target-os) =% notice! "" :musl "musl-gcc" which :musl-gcc (musl-gcc length 0 >) ("--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc" @musl) when "nim c $# -d:ssl -d:useOpenSsl3 $# --opt:size --cpu:amd64 --os:$# $#-o:$# min" (d-stage musl target-os d-variant o-variant) =% puts system pop (pack-result) ( {} target-os "os" dset config "version" dget "version" dset o-variant "exe" dset pack ) when ) ) :: ;; Builds and packs a min executable. #|| Tasks ||# ( symbol guide (==>) ( "hastyscribe" required "Building - guide" notice! "hastyscribe Min_DeveloperGuide.md --field/version=$#" (version) =% !! "cp Min_DeveloperGuide.htm site/output/guide.dev.html" !! ) ) :: ;; Builds the developer guide. ( symbol site (==>) ( "hastysite" required "Building - site" notice! "cd site && hastysite build && cd .." !! ) ) :: ;; Builds the min site. ( symbol pack (dict :vdata ==>) ( vdata "exe" dget :exe (vdata "os" dget "windows" ==) ("$#.exe" (exe) =% @exe) when "$exe:_v$version:_$os:_x64.zip" :fn fn vdata dpairs % ":" "" replace @fn "Compressing: $#" (fn) =% notice! (exe) => fn zip ) ) :: ;; Compresses a min executable. ( symbol vim (==>) ( config "version" dget :min-version "tasks/data/min.vim" fread :template timestamp "dd MMM YYYY" tformat :date min-symbols ("||" !=) filter " " join :symbols "min.vim" :out-file "Building - min.vim" notice! template ("date" date "version" min-version "symbols" symbols) =% out-file fwrite ) ) :: ;; Generates the min.vim file. ( symbol docs (==>) ( guide site ) ) :: ;; Generate the min development guide and site. ( symbol dev (==>) ("dev" "" os cz) ) :: ;; Builds min (dev version) on the current OS. ( symbol default (==>) ("release-nopack" "" os cz) ) :: ;; Builds min on the current OS. ( symbol linux (==>) ("" "" "linux" cz) ) :: ;; Builds min for Linux. ( symbol macosx (==>) ("" "" "macosx" cz) ) :: ;; Builds min for macOS. ( symbol windows (==>) ("" "" "windows" cz) ) :: ;; Builds min for Windows.
M tasks/clean.mintasks/clean.min

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

-#!/usr/bin/env min #| Tasks |# ( symbol default (==>) ( "Cleaning up build files" notice! . ls ("(/(mini|lite)?min|\.(htm|zip|exe))$" match?) filter :files files 'rm foreach "Done." notice! ) ) :: ;; Deletes min build files +#!/usr/bin/env min #| Tasks |# ( symbol default (==>) ( "Cleaning up build files" notice! pwd ls ("(/(mini|lite)?min|\\.(htm|zip|exe))$" match?) filter :files files 'rm foreach "Done." notice! ) ) :: ;; Deletes min build files
M tasks/github.mintasks/github.min

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

-#!/usr/bin/env min "_helpers" require :helpers 'helpers import "next-release.md" fread escape :release-body "tasks/data/draft-release.json" fread :draft-release-template config /version :min-version env /github-token :token draft-release-template ("version" min-version "body" release-body) =% :draft-release-body {} "application/vnd.github.v3+json" %Accept "token $#" (token) =% %Authorization :headers ( symbol handle-errors (dict :response ==>) ( response to-json "response.json" fwrite response /status :status (status 300 >) ( response /body from-json :body body /message :message status string @status "Error $#: $#" (status message) =% error status int exit ) when ) ) :: ;; Handles HTTP errors. ( symbol gh-req (dict :data ==> dict|quot :result) ( data /endpoint :endpoint "api" :subdomain (data 'subdomain dhas?) (data /subdomain @subdomain) when "https://$#.github.com/repos/h3rald/min$#" (subdomain endpoint) =% :url {} url %url data /method %method (data 'headers dhas?) (data /headers %headers) (headers %headers) if (data 'body dhas?) (data /body %body) when request :response response /status :status response /body :body response handle-errors (body length 0 >) (body from-json) ({}) if @result ) ) :: ;; Execute a request using the Github API. ( symbol get-assets (dict :data ==> quot :result) ( data /id :id {} "/releases/$#/assets" (id) =% %endpoint "GET" %method gh-req @result ) ) :: ;; Retrieve the assets from an existing Github release. ( symbol delete-assets (dict :config ==>) ( config get-assets :assets config /id :id assets (/id) map :assets-ids assets-ids ( :asset {} "/releases/assets/$#" (asset) =% %endpoint "DELETE" %method gh-req pop ) foreach ) ) :: ;; Delete all assets from an existing Github release. #| Tasks |# ( symbol draft (==>) ( {} "/releases" %endpoint "POST" %method draft-release-body %body gh-req /id string :id ; Save Release ID to min.yml config id %id to-yaml "min.yml" fwrite "Draft release v$# ($#) created successfully" (min-version id) =% notice! ) ) :: ;; Creates a new draft release on Github. ( symbol update (==>) ( config /id :id {} "/releases/$#" (id) =% %endpoint "PATCH" %method draft-release-body %body gh-req /id string :id "Draft release v$# ($#) updated successfully" (min-version id) =% notice! ) ) :: ;; Updates the text of the current draft Github release. ( symbol assets (==>) ( config get-assets =assets assets size :total "are" :verb (total 1 ==) ("is" @verb) when "There $# $# assets in release v$#" (verb total min-version) =% notice! assets (/name () cons "- $#" swap % notice!) foreach ) ) :: ;; Retrieve a list of all the assets of the current draft Github release. ( symbol upload (==>) ( config /id :id config delete-assets . ls ("\.zip$" match?) filter ( filename :file "Uploading: $#" (file) =% notice! file fread :body headers "application/zip" %Content-Type :asset-headers {} "/releases/$#/assets?name=$#" (id file) =% %endpoint asset-headers %headers "uploads" %subdomain "POST" %method body %body gh-req pop ) foreach ) ) :: ;; Uploads all assets to the current draft Github release, deleting any existing asset. +#!/usr/bin/env min "_helpers" require :helpers 'helpers import "next-release.md" fread escape :release-body "tasks/data/draft-release.json" fread :draft-release-template config "version" dget :min-version env "github-token" dget :token draft-release-template ("version" min-version "body" release-body) =% :draft-release-body {} "application/vnd.github.v3+json" "Accept" dset "token $#" (token) =% "Authorization" dset :headers ( symbol handle-errors (dict :response ==>) ( response to-json "response.json" fwrite response "status" dget :status (status 300 >) ( response "body" dget from-json :body body "message" dget :message status string @status "Error $#: $#" (status message) =% error status int exit ) when ) ) :: ;; Handles HTTP errors. ( symbol gh-req (dict :data ==> dict|quot :result) ( data "endpoint" dget :endpoint "api" :subdomain (data 'subdomain dhas?) (data "subdomain" dget @subdomain) when "https://$#.github.com/repos/h3rald/min$#" (subdomain endpoint) =% :url {} url "url" dset data "method" dget "method" dset (data 'headers dhas?) (data "headers" dget "headers" dset) (headers "headers" dset) if (data 'body dhas?) (data "body" dget "body" dset) when request :response response "status" dget :status response "body" dget :body response handle-errors (body length 0 >) (body from-json) ({}) if @result ) ) :: ;; Execute a request using the Github API. ( symbol get-assets (dict :data ==> quot :result) ( data "id" dget :id {} "/releases/$#/assets" (id) =% "endpoint" dset "GET" "method" dset gh-req @result ) ) :: ;; Retrieve the assets from an existing Github release. ( symbol delete-assets (dict :config ==>) ( config get-assets :assets config "id" dget :id assets ("id" dget) map :assets-ids assets-ids ( :asset {} "/releases/assets/$#" (asset) =% "endpoint" dset "DELETE" "method" dset gh-req pop ) foreach ) ) :: ;; Delete all assets from an existing Github release. #|| Tasks ||# ( symbol draft (==>) ( {} "/releases" "endpoint" dset "POST" "method" dset draft-release-body "body" dset gh-req "id" dget string :id ;; Save Release ID to min.yml config id "id" dset to-yaml "min.yml" fwrite "Draft release v$# ($#) created successfully" (min-version id) =% notice! ) ) :: ;; Creates a new draft release on Github. ( symbol update (==>) ( config "id" dget :id {} "/releases/$#" (id) =% "endpoint" dset "PATCH" "method" dset draft-release-body "body" dset gh-req "id" dget string :id "Draft release v$# ($#) updated successfully" (min-version id) =% notice! ) ) :: ;; Updates the text of the current draft Github release. ( symbol assets (==>) ( config get-assets =assets assets size :total "are" :verb (total 1 ==) ("is" @verb) when "There $# $# assets in release v$#" (verb total min-version) =% notice! assets ("name" dget () cons "- $#" swap % notice!) foreach ) ) :: ;; Retrieve a list of all the assets of the current draft Github release. ( symbol upload (==>) ( config "id" dget :id config delete-assets pwd ls ("\\.zip$" match?) filter ( filename :file "Uploading: $#" (file) =% notice! file fread :body headers "application/zip" "Content-Type" dset :asset-headers {} "/releases/$#/assets?name=$#" (id file) =% "endpoint" dset asset-headers "headers" dset "uploads" "subdomain" dset "POST" "method" dset body "body" dset gh-req pop ) foreach ) ) :: ;; Uploads all assets to the current draft Github release, deleting any existing asset.
M tasks/h3rald.mintasks/h3rald.min

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

-#!/usr/bin/env min "_helpers" require :helpers 'helpers import config /version :min-version "Min_DeveloperGuide.htm" :guide-file "../h3rald/assets/min/" guide-file suffix :h3rald-guide "../h3rald/contents/min.md" :h3rald-min-md "version:\s+\d+\.\d+\.\d+" :min-v-reg "version: $#" (min-version) =% :min-v-rep ( symbol update (==>) ( "Updating min Developer Guide and project on H3RALD.com..." notice! guide-file h3rald-guide cp h3rald-min-md fread min-v-reg min-v-rep replace :updated-contents updated-contents h3rald-min-md fwrite "Done." notice! ) ) :: ;; Updates the min Developer Guide and project page on H3RALD.com ( symbol build (==>) ( "git" required "hastysite" required "Pulling content and rebuilding H3RALD.com web site..." notice! ; Assuming min and h3rald are siblings .. cd "h3rald" cd "git pull" !! "hastysite build" !! .. cd "min" cd ) ) :: ;; Builds H3RALD.com web site +#!/usr/bin/env min "_helpers" require :helpers 'helpers import config "version" dget :min-version "Min_DeveloperGuide.htm" :guide-file "../h3rald/assets/min/" guide-file suffix :h3rald-guide "../h3rald/contents/min.md" :h3rald-min-md "version:\\s+\\d+\\.\\d+\\.\\d+" :min-v-reg "version: $#" (min-version) =% :min-v-rep ( symbol update (==>) ( "Updating min Developer Guide and project on H3RALD.com..." notice! guide-file h3rald-guide cp h3rald-min-md fread min-v-reg min-v-rep replace :updated-contents updated-contents h3rald-min-md fwrite "Done." notice! ) ) :: ;; Updates the min Developer Guide and project page on H3RALD.com ( symbol build (==>) ( "git" required "hastysite" required "Pulling content and rebuilding H3RALD.com web site..." notice! ;; Assuming min and h3rald are siblings parent-dir cd "h3rald" cd "git pull" !! "hastysite build" !! parent-dir cd "min" cd ) ) :: ;; Builds H3RALD.com web site
M tasks/help.mintasks/help.min

@@ -1,1 +1,155 @@

-"tasks/data/doc-snippets.json" fread from-json :snippets "site/contents" ls ("reference-" match?) filter :src-files "(?sm)\{#op\|\|([^|]+)\|\|([^|]+)\|\|([^|]+)\|\|(.+?)#\}" :op-regex "(?sm)\{#sig\|\|([^|]+)\|\|([^#]+)#\}" :sig-regex "(?sm)\{#alias\|\|([^|]+)\|\|([^#]+)#\}" :alias-regex "(?sm)\{\{([^}]+)\}\}" :snippet-regex "(?sm)\>( \>)*" :block-regex "(?sm)%([^%]+)%" :title-regex "(?sm)\{@[^@]+@\}" :incl-regex "(?sm)`([^`]+)`" :code-regex ( symbol fix-name (str :s ==> str :result) ( s "&excl;" (pop "!") replace-apply "&quot;" (pop "\"") replace-apply "&#124;" (pop "|") replace-apply "\[" (pop "") replace-apply "\]" (pop "") replace-apply "\(class:kwd\)" (pop "") replace-apply "&gt;" (pop ">") replace-apply "&lt;" (pop "<") replace-apply "&apos;" (pop "'") replace-apply "&ast;" (pop "*") replace-apply @result ) ) :: ;; Fixes names with special characters ( symbol process-block-markup (str :s ==> str :result) ( s block-regex (pop "") replace-apply title-regex (pop "") replace-apply incl-regex (pop "") replace-apply code-regex (1 get) replace-apply @result ) ) :: ;; Simplify block-level markup ( symbol process-snippets (str :s ==> str :result) ( s snippet-regex ( 1 get :id snippets id dget ) replace-apply @result ) ) :: ;; Resolves documentation snippets. ( symbol process (str :s ==> str :result) ( s process-snippets process-block-markup strip @result ) ) :: ;; Processes documentation snippets and markup. ( symbol process-op (quot :matches ==> dict :data) ( {} matches 1 get process fix-name %name matches 2 get process fix-name :input matches 3 get process fix-name :output "$# ==> $#" (input output) =% %signature matches 4 get process %description "symbol" %kind @data ) ) :: ;; Processes operator reference documentation. ( symbol process-alias (quot :matches ==> dict :data) ( {} matches 1 get process fix-name %name matches 2 get :ref "See $#" (ref) =% %description "symbol" %kind @data ) ) :: ;; Processes alias reference documentation. ( symbol process-sig (quot :matches ==> dict :data) ( {} matches 1 get process fix-name %name matches 2 get :ref "See $#" (ref) =% %description "sigil" %kind @data ) ) :: ;; Processes sigil reference documentation. ( symbol default (==>) ( {} :ref-dict {} :op-dict {} :sig-dict src-files ( :file file "reference-([a-z]+)\.md" search 1 get :mod-id "Processing: $#" (mod-id) =% notice! file fread :contents contents op-regex search-all ( process-op :op op /name :op-name op-dict op op-name dset @op-dict ) foreach contents alias-regex search-all ( process-alias :alias alias /name :alias-name op-dict alias alias-name dset @op-dict ) foreach contents sig-regex search-all ( process-sig :sig sig /name :sig-name sig-dict sig sig-name dset @sig-dict ) foreach ref-dict op-dict %operators sig-dict %sigils @ref-dict ) foreach "Writing help.json" notice! ref-dict to-json "help.json" fwrite ) ) :: ;; Builds the reference help JSON sources. +"tasks/data/doc-snippets.json" fread from-json :snippets +"site/contents" ls ("reference-" match?) filter :src-files +"(?sm)\\{#op\\|\\|([^|]+)\\|\\|([^|]+)\\|\\|([^|]+)\\|\\|(.+?)#\\}" :op-regex +"(?sm)\\{#sig\\|\\|([^|]+)\\|\\|([^#]+)#\\}" :sig-regex +"(?sm)\\{#alias\\|\\|([^|]+)\\|\\|([^#]+)#\\}" :alias-regex +"(?sm)\\{\\{([^}]+)\\}\\}" :snippet-regex +"(?sm)\\>( \\>)*" :block-regex +"(?sm)%([^%]+)%" :title-regex +"(?sm)\\{@[^@]+@\\}" :incl-regex +"(?sm)`([^`]+)`" :code-regex + +( + symbol fix-name + (str :s ==> str :result) + ( + s + "&excl;" (pop "!") replace-apply + "&quot;" (pop "\"") replace-apply + "&#124;" (pop "|") replace-apply + "\\[" (pop "") replace-apply + "\\]" (pop "") replace-apply + "\\(class:kwd\\)" (pop "") replace-apply + "&gt;" (pop ">") replace-apply + "&lt;" (pop "<") replace-apply + "&apos;" (pop "'") replace-apply + "&ast;" (pop "*") replace-apply + @result + ) +) :: +;; Fixes names with special characters +( + symbol process-block-markup + (str :s ==> str :result) + ( + s + block-regex (pop "") replace-apply + title-regex (pop "") replace-apply + incl-regex (pop "") replace-apply + code-regex (1 get) replace-apply + @result + ) +) :: +;; Simplify block-level markup + +( + symbol process-snippets + (str :s ==> str :result) + ( + s snippet-regex ( + 1 get :id + snippets id dget + ) replace-apply @result + ) +) :: +;; Resolves documentation snippets. + +( + symbol process + (str :s ==> str :result) + ( + s process-snippets process-block-markup strip @result + ) +) :: +;; Processes documentation snippets and markup. + +( + symbol process-op + (quot :matches ==> dict :data) + ( + {} + matches 1 get process fix-name "name" dset + matches 2 get process fix-name :input + matches 3 get process fix-name :output + "$# ==> $#" (input output) =% "signature" dset + matches 4 get process "description" dset + "symbol" "kind" dset + @data + ) +) :: +;; Processes operator reference documentation. + +( + symbol process-alias + (quot :matches ==> dict :data) + ( + {} + matches 1 get process fix-name "name" dset + matches 2 get :ref + "See $#" (ref) =% "description" dset + "symbol" "kind" dset + @data + ) +) :: +;; Processes alias reference documentation. + +( + symbol process-sig + (quot :matches ==> dict :data) + ( + {} + matches 1 get process fix-name "name" dset + matches 2 get :ref + "See $#" (ref) =% "description" dset + "sigil" "kind" dset + @data + ) +) :: +;; Processes sigil reference documentation. + +( + symbol default + (==>) + ( + {} :ref-dict + {} :op-dict + {} :sig-dict + src-files ( + :file + file "reference-([a-z]+)\\.md" search 1 get :mod-id + "Processing: $#" (mod-id) =% notice! + file fread :contents + contents op-regex search-all ( + process-op :op + op "name" dget :op-name + op mod-id 'module dset @op + op-dict + op op-name dset + @op-dict + ) foreach + contents alias-regex search-all ( + process-alias :alias + alias "name" dget :alias-name + alias mod-id 'module dset @alias + op-dict + alias alias-name dset + @op-dict + ) foreach + contents sig-regex search-all ( + process-sig :sig + sig "name" dget :sig-name + sig mod-id 'module dset @sig + sig-dict + sig sig-name dset + @sig-dict + ) foreach + ref-dict + op-dict "symbols" dset + sig-dict "sigils" dset + @ref-dict + ) foreach + "Writing help.json" notice! + ref-dict to-json "help.json" fwrite + ) +) :: +;; Builds the reference help JSON sources.
M tasks/release.mintasks/release.min

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

-#!/usr/bin/env min "build" require :build "github" require :github #| Tasks |# ( symbol default (==>) ( *build/guide *build/site *build/vim *build/windows *build/linux *build/macosx *github/update *github/upload ) ) :: ;; Builds min executables and updates the current draft Github release. +#!/usr/bin/env min "build" require :build "github" require :github #| Tasks |# ( symbol default (==>) ( build.guide build.site build.vim build.windows build.linux build.macosx github.update github.upload ) ) :: ;; Builds min executables and updates the current draft Github release.
M tasks/version.mintasks/version.min

@@ -5,7 +5,7 @@ "min.nimble" :nimble-cfg

"site/settings.json" :json-site-cfg yaml-cfg fread from-yaml :config -config /version :old-version +config "version" dget :old-version nimble-cfg fread :nimble-data

@@ -13,7 +13,7 @@ (

symbol update-yaml-config ('sym :new-version ==>) ( - config new-version %version @config + config new-version "version" dset @config config to-yaml yaml-cfg fwrite ) ) ::

@@ -24,7 +24,7 @@ symbol update-site-config

('sym :new-version ==>) ( json-site-cfg fread from-json :site-config - site-config new-version %version @site-config + site-config new-version "version" dset @site-config site-config to-json json-site-cfg fwrite ) ) ::

@@ -34,15 +34,15 @@ (

symbol update-nimble-config ('sym :new-version ==>) ( - "(version\s+=\s*)([^\s]+)(\s*)" :version-regexp + "(version\\s+=\\s*)([^\\s]+)(\\s*)" :version-regexp nimble-data version-regexp - (dup 1 get :start 3 get :end "$#\"$#\"$#" (start new-version end) =% puts) replace-apply @nimble-data + (dup 1 get :start 3 get :end "$#\"$#\"$#" (start new-version end) =%) replace-apply @nimble-data nimble-data nimble-cfg fwrite ) ) :: ;; Updates the version in the nimble file to new-version. -#| Tasks |# +#|| Tasks ||# ( symbol set
M tests/crypto.mintests/crypto.min

@@ -1,25 +1,25 @@

'min-test require :test ;;; -"crypto" *test/describe +"crypto" test.describe - ("test" md4 "db346d691d7acc4dc2625db19f9e3f52" ==) *test/assert + ("test" md4 "db346d691d7acc4dc2625db19f9e3f52" ==) test.assert - ("test" md5 "098f6bcd4621d373cade4e832627b4f6" ==) *test/assert + ("test" md5 "098f6bcd4621d373cade4e832627b4f6" ==) test.assert - ("test" sha1 "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" ==) *test/assert + ("test" sha1 "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" ==) test.assert - ("test" sha224 "90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809" ==) *test/assert + ("test" sha224 "90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809" ==) test.assert - ("test" sha256 "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ==) *test/assert + ("test" sha256 "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ==) test.assert - ("test" sha384 "768412320f7b0aa5812fce428dc4706b3cae50e02a64caa16a782249bfe8efc4b7ef1ccb126255d196047dfedf17a0a9" ==) *test/assert + ("test" sha384 "768412320f7b0aa5812fce428dc4706b3cae50e02a64caa16a782249bfe8efc4b7ef1ccb126255d196047dfedf17a0a9" ==) test.assert - ("test" sha512 "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" ==) *test/assert + ("test" sha512 "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" ==) test.assert - ("test" encode decode "test" ==) *test/assert + ("test" encode decode "test" ==) test.assert - ("test" "test" aes "test" aes strip "test" ==) *test/assert + ("test" "test" aes "test" aes strip "test" ==) test.assert - *test/report + test.report clear-stack
M tests/dict.mintests/dict.min

@@ -1,54 +1,54 @@

'min-test require :test ;;; -"dict" *test/describe +"dict" test.describe - ((("a" 1)("b" 2)("c" 3)) dictionary? not) *test/assert + ((("a" 1)("b" 2)("c" 3)) dictionary? not) test.assert - ({1 :a 2 :b 3 :c} dictionary?) *test/assert + ({1 :a 2 :b 3 :c} dictionary?) test.assert - ({1 :a 2 :b 3 :c} 'b dget 2 ==) *test/assert + ({1 :a 2 :b 3 :c} 'b dget 2 ==) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) *test/assert + ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 "d" dset :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) *test/assert + ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 "d" dset :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 'b ddel {1 :a 3 :c} ==) *test/assert + ({1 :a 2 :b 3 :c} :dict1 dict1 'b ddel {1 :a 3 :c} ==) test.assert - ({1 :a 2 :b 3 :c} dkeys ("a" "b" "c") ==) *test/assert + ({1 :a 2 :b 3 :c} dkeys ("a" "b" "c") ==) test.assert - ({1 :a 2 :b 3 :c} dvalues (1 2 3) ==) *test/assert + ({1 :a 2 :b 3 :c} dvalues (1 2 3) ==) test.assert - (global dtype "module" ==) *test/assert + (global dtype "module" ==) test.assert - ({} dtype "" ==) *test/assert + ({} dtype "" ==) test.assert - ({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) *test/assert + ({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) test.assert - (2 2 {+ :plus} /plus 4 ==) *test/assert + (2 2 {+ :plus} "plus" dget 4 ==) test.assert - (2 {(2 3 +) :sum} /sum -> + 7 ==) *test/assert + (2 {(2 3 +) :sum} "sum" dget -> + 7 ==) test.assert - ({a :test} "test" dget-raw /str "a" ==) *test/assert + ({a :test} "test" dget-raw "str" dget "a" ==) test.assert - ({} 'aaa 'test dset-sym {aaa :test} ==) *test/assert + ({} 'aaa 'test dset-sym {aaa :test} ==) test.assert ( {} :archives ({"a" :a 2 :b} {"aa" :a 4 :b} {"aaa" :a 6 :b}) ( :article - article /a :code + article "a" dget :code {} - code %code + code "code" dset :archive archives archive code dset @archives ) foreach - archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) *test/assert + archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) test.assert ( {1 :a 2 :b 3 :c} dpairs ((1 "a") (2 "b") (3 "c")) == - ) *test/assert + ) test.assert - *test/report + test.report clear-stack
M tests/dstore.mintests/dstore.min

@@ -1,37 +1,37 @@

'min-test require :test ;;; -"dstore" *test/describe +"dstore" test.describe - ("dstore.json" dsinit type "dict:datastore" ==) *test/assert + ("dstore.json" dsinit type "dict:datastore" ==) test.assert ( "dstore.json" dsread :ds ds "tests" {} - 1 %test1 - 2 %test2 + 1 "test1" dset + 2 "test2" dset dspost dswrite "tests" (pop true) dsquery size 1 == - ) *test/assert + ) test.assert ( "dstore.json" dsread :ds ds "tests/aaa" {} - 1 %test1 - 3 %test3 + 1 "test1" dset + 3 "test3" dset dsput dswrite - "tests" (/test1 1 ==) dsquery size 2 == - ) *test/assert + "tests" ("test1" dget 1 ==) dsquery size 2 == + ) test.assert ( "dstore.json" dsread :ds ds "tests/aaa" dsdelete - "tests" (/id "aaa" ==) dsquery size 0 == - ) *test/assert + "tests" ("id" dget "aaa" ==) dsquery size 0 == + ) test.assert "dstore.json" rm - *test/report + test.report clear-stack
M tests/fs.mintests/fs.min

@@ -1,44 +1,44 @@

'min-test require :test ;;; -"fs" *test/describe +"fs" test.describe "TEST" "test.txt" fwrite - ("test.txt" fsize 4 ==) *test/assert + ("test.txt" fsize 4 ==) test.assert - ("test.txt" fperms 644 >=) *test/assert + ("test.txt" fperms 644 >=) test.assert - ("test.txt" ftype "file" ==) *test/assert + ("test.txt" ftype "file" ==) test.assert - ("test.txt" hidden? false ==) *test/assert + ("test.txt" hidden? false ==) test.assert - ("test.txt" fstats 'type dget "file" ==) *test/assert + ("test.txt" fstats 'type dget "file" ==) test.assert - ("tests" dir?) *test/assert + ("tests" dir?) test.assert - ("tests" exists?) *test/assert + ("tests" exists?) test.assert - ("tests/fs.min" file?) *test/assert + ("tests/fs.min" file?) test.assert - (("a" "b" "c") join-path "a/b/c" ==) *test/assert + (("a" "b" "c") join-path "a/b/c" ==) test.assert - ("/home/h3rald" windows-path "\\home\\h3rald" ==) *test/assert + ("/home/h3rald" windows-path "\\home\\h3rald" ==) test.assert - ("/home/h3rald" absolute-path?) *test/assert + ("/home/h3rald" absolute-path?) test.assert - ("tests/sys.min" expand-filename unix-path . "/tests/sys.min" suffix unix-path ==) *test/assert + ("tests/sys.min" expand-filename unix-path pwd "/tests/sys.min" suffix unix-path ==) test.assert - ("./../tests" normalized-path unix-path "../tests" ==) *test/assert + ("./../tests" normalized-path unix-path "../tests" ==) test.assert - ((. "tests/global.min") => join-path . relative-path unix-path "tests/global.min" ==) *test/assert + ((pwd "tests/global.min") => join-path pwd relative-path unix-path "tests/global.min" ==) test.assert - ("tests/global.min" absolute-path unix-path (. "tests/global.min") => join-path unix-path ==) *test/assert + ("tests/global.min" absolute-path unix-path (pwd "tests/global.min") => join-path unix-path ==) test.assert - ("./test" absolute-path? not) *test/assert + ("./test" absolute-path? not) test.assert - ("c:/windows" windows-path "c:\\windows" ==) *test/assert + ("c:/windows" windows-path "c:\\windows" ==) test.assert - *test/report + test.report clear-stack "test.txt" rm
M tests/global.mintests/global.min

@@ -1,17 +1,17 @@

'min-test require :test ;;; -"global" *test/describe +"global" test.describe (2 'a define - (3 a + (5 'a define a) -> +) -> a + 12 ==) *test/assert + (3 a + (5 'a define a) -> +) -> a + 12 ==) test.assert - (symbols "a" in? false ==) *test/assert + (symbols "a" in? false ==) test.assert - ('abcdefg defined-symbol? false ==) *test/assert + ('abcdefg defined-symbol? false ==) test.assert 5 :five - (symbols "five" in?) *test/assert + (symbols "five" in?) test.assert ( (1 2 3 4 5 6) :test-data

@@ -27,97 +27,97 @@ test-data def foreach

_2 -> _5 -> _1 -> + + 30 == - ) *test/assert + ) test.assert ( (dup *) ^square 3 square 9 == - ) *test/assert + ) test.assert 'five delete-symbol - (symbols "five" in? false ==) *test/assert + (symbols "five" in? false ==) test.assert - ("3 4 +" eval 7 ==) *test/assert + ("3 4 +" eval 7 ==) test.assert - ("2 2 +" "tests/testload.min" fwrite 'testload load 4 ==) *test/assert + ("2 2 +" "tests/testload.min" fwrite 'testload load 4 ==) test.assert "tests/testload.min" rm - ("2 :two 3 :three" "tests/testrequire.min" fwrite 'testrequire require :tm *tm/two *tm/three + 5 ==) *test/assert + ("2 :two 3 :three" "tests/testrequire.min" fwrite 'testrequire require :tm tm.two tm.three + 5 ==) test.assert "tests/testrequire.min" rm - (2 quote (2) ==) *test/assert + (2 quote (2) ==) test.assert - ((2 3) dequote get-stack (2 3) ==) *test/assert + ((2 3) dequote get-stack (2 3) ==) test.assert - (3 (succ) 3 times 6 ==) *test/assert + (3 (succ) 3 times 6 ==) test.assert - ((2 3 >) ("YES") ("NO") if "NO" ==) *test/assert - ((2 3 <) ("YES") ("NO") if "YES" ==) *test/assert + ((2 3 >) ("YES") ("NO") if "NO" ==) test.assert + ((2 3 <) ("YES") ("NO") if "YES" ==) test.assert - ("NO" (2 3 >) ("YES") when "NO" ==) *test/assert + ("NO" (2 3 >) ("YES") when "NO" ==) test.assert - ((2 3 <) ("YES") when "YES" ==) *test/assert + ((2 3 <) ("YES") when "YES" ==) test.assert - ((2 3 >) ("YES") unless "YES" ==) *test/assert + ((2 3 >) ("YES") unless "YES" ==) test.assert - (1 type "int" ==) *test/assert - ({} type "dict" ==) *test/assert - (global type "dict:module" ==) *test/assert + (1 type "int" ==) test.assert + ({} type "dict" ==) test.assert + (global type "dict:module" ==) test.assert - (5 (dup 0 ==) (1 +) (dup 1 -) ( * ) linrec 120 ==) *test/assert ;factorial of 5 + (5 (dup 0 ==) (1 +) (dup 1 -) ( * ) linrec 120 ==) test.assert ;;factorial of 5 ( ( (pop) ('error dget) ("finally") - ) try get-stack ("MinEmptyStackError" "finally") ==) *test/assert + ) try get-stack ("MinEmptyStackError" "finally") ==) test.assert - ("aaaa" :cd cd "aaaa" ==) *test/assert ;It is possible to shadow sealed symbols in child scopes + ("aaaa" :cd cd "aaaa" ==) test.assert ;;It is possible to shadow sealed symbols in child scopes - (((2 :a1 'a1 seal-symbol 3 :a1) ("failed")) try "failed" ==) *test/assert + (((2 :a1 'a1 seal-symbol 3 :a1) ("failed")) try "failed" ==) test.assert ( 1 :a1 'a1 seal-symbol 'a1 unseal-symbol 2 :a1 - 2 a1 ==) *test/assert + 2 a1 ==) test.assert ( ( ({"TestError" :error "Test Message" :message} raise) - (/error) - ) try "TestError" ==) *test/assert + ("error" dget) + ) try "TestError" ==) test.assert ( - (("test" °test :)) try get-stack ("test") ==) *test/assert + (("test" °test :)) try get-stack ("test") ==) test.assert ( ( (() 1 get) (1) - ) try 1 ==) *test/assert + ) try 1 ==) test.assert - ((a b +) {4 :a 5 :b} with 9 ==) *test/assert + ((a b +) {4 :a 5 :b} with 9 ==) test.assert - ("{\"a\": 1, \"b\": 2.3}" from-json {1 :a 2.3 :b} ==) *test/assert + ("{\"a\": 1, \"b\": 2.3}" from-json {1 :a 2.3 :b} ==) test.assert - ((1 2 3 "aaa" 'q q true) to-json "\r\n" "" replace "\n" "" replace " " "" replace "[1,2,3,\"aaa\",\";sym:'q\",\";sym:q\",true]" ==) *test/assert + ((1 2 3 "aaa" 'q q true) to-json "\r\n" "" replace "\n" "" replace " " "" replace "[1,2,3,\"aaa\",\";sym:'q\",\";sym:q\",true]" ==) test.assert - ((1 2 3 "aaa" 'q q true) to-json from-json (1 2 3 "aaa" 'q q true) ==) *test/assert + ((1 2 3 "aaa" 'q q true) to-json from-json (1 2 3 "aaa" 'q q true) ==) test.assert - (((1 2 3)) :sym1 >sym1 saved-symbols "sym1" in?) *test/assert + (((1 2 3)) :sym1 "sym1" save-symbol saved-symbols "sym1" in?) test.assert - (<sym1 symbols "sym1" in?) *test/assert + ("sym1" load-symbol symbols "sym1" in?) test.assert - ('sym1 remove-symbol saved-symbols "sym1" in? false ==) *test/assert + ('sym1 remove-symbol saved-symbols "sym1" in? false ==) test.assert - (0 :temp (1 2 3) (temp + @temp) foreach 6 temp ==) *test/assert + (0 :temp (1 2 3) (temp + @temp) foreach 6 temp ==) test.assert ( (1 +) ^mysucc - 'mysucc source (1 +) ==) *test/assert + 'mysucc source (1 +) ==) test.assert (6 (

@@ -125,65 +125,65 @@ ((3 ==) (false))

((3 <) (false)) ((3 >) (true)) ) case - ) *test/assert + ) test.assert - (time scope-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) *test/assert + (time scope-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) test.assert - (sys scope-sigils ("!" "$" "&") ==) *test/assert + (global scope-sigils "$" in?) test.assert - ({3 :a 5 :b} scope-symbols ("a" "b") ==) *test/assert + ({3 :a 5 :b} scope-symbols ("a" "b") ==) test.assert (dev?) - ((opts {true :d} ==) *test/assert) - ((opts {} ==) *test/assert) + ((opts {true :d} ==) test.assert) + ((opts {} ==) test.assert) if - (args first "\.min$" match?) *test/assert + (args first "\\.min$" match?) test.assert - (3 string "3" ==) *test/assert + (3 string "3" ==) test.assert - ("false" boolean false ==) *test/assert + ("false" boolean false ==) test.assert - ("" boolean false ==) *test/assert + ("" boolean false ==) test.assert - (0 boolean false ==) *test/assert + (0 boolean false ==) test.assert - (false boolean false ==) *test/assert + (false boolean false ==) test.assert - (0.0 boolean false ==) *test/assert + (0.0 boolean false ==) test.assert - ("something" boolean true ==) *test/assert + ("something" boolean true ==) test.assert - ("345" integer 345 ==) *test/assert + ("345" integer 345 ==) test.assert - (true integer 1 ==) *test/assert + (true integer 1 ==) test.assert - (3.5 integer 3 ==) *test/assert + (3.5 integer 3 ==) test.assert - (3.5 float 3.5 ==) *test/assert + (3.5 float 3.5 ==) test.assert - (3 float 3.0 ==) *test/assert + (3 float 3.0 ==) test.assert - (false float 0.0 ==) *test/assert + (false float 0.0 ==) test.assert - ("3.678" float 3.678 ==) *test/assert + ("3.678" float 3.678 ==) test.assert ( {1 :a 2 :b 3 :c} ( - (dup /a succ succ %a) - (dup /b succ %b) + (dup "a" dget succ succ "a" dset) + (dup "b" dget succ "b" dset) ) tap {3 :a 3 :b 3 :c} == - ) *test/assert + ) test.assert ( {} :data data ( - 1 %a - 2 %b + 1 "a" dset + 2 "b" dset ) tap {1 :a 2 :b} == - ) *test/assert + ) test.assert ( "" :s1

@@ -193,17 +193,17 @@ (' "2" swap append "" join)

(' "3" swap append "" join @s1 s1) ) tap! s1 "test123" == - ) *test/assert + ) test.assert - (3.4 "test" 1 (int str num) expect (3.4 "test" 1) ==) *test/assert + (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 + ("aaa bbb ccc 2 2 + (2 3 4)" parse (aaa bbb ccc 2 2 + (2 3 4)) ==) test.assert - ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) *test/assert + ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) test.assert - ((2 < 3 and (4 > 2)) >< true) *test/assert + ((2 < 3 and (4 > 2)) >< true) test.assert - ((float 3) >> 3.0 ==) *test/assert + ((float 3) >> 3.0 ==) test.assert ( (

@@ -212,7 +212,7 @@ (str :in ==> str :out)

(in "--" suffix "--" prefix @out) ) :: del"test" "--test--" == - ) *test/assert + ) test.assert ( (

@@ -222,11 +222,11 @@ (in "x" prefix @out)

) :: 'x unseal-sigil 'x delete-sigil 'x defined-sigil? false == - ) *test/assert + ) test.assert ( - {{100 :b} :a} :test *test/a/b 100 == - ) *test/assert + {{100 :b} :a} :test test.a.b 100 == + ) test.assert ( (

@@ -239,7 +239,7 @@ base (dup) n times (*) n times @pr

) ) operator 2 4 pow-mul - 8 == - ) *test/assert + ) test.assert ( (

@@ -260,15 +260,15 @@ false @result

) ) :: nt"flt" - ) *test/assert + ) test.assert - ; (:n ((n integer?) (n 0 >)) &&) 'natural typeclass + ;; (:n ((n integer?) (n 0 >)) &&) 'natural typeclass ( typeclass natural (int :n ==> bool :out) - (((n integer?) (n 0 >)) && @out) + (((n integer?) (n 0 >)) "&" run @out) ) :: - ("typeclass:natural" defined-symbol?) *test/assert + ("typeclass:natural" defined-symbol?) test.assert ( symbol natural-sum (natural :n natural :m ==> natural :result)

@@ -281,9 +281,9 @@ (

(3 -3 natural-sum) (@err) ) try - pop ;Remove 3 that was left on the stack. - (err format-error "expected: natural natural natural-sum" match?) *test/assert - (2 3 natural-sum 5 ==) *test/assert + pop ;;Remove 3 that was left on the stack. + (err format-error "expected: natural natural natural-sum" match?) test.assert + (2 3 natural-sum 5 ==) test.assert ) when

@@ -293,11 +293,11 @@ constructor test-c

(str :in ==> dict :out) ( {} - in %test + in "test" dset @out ) ) :: - ("aaa" test-c 'dict:test-c type?) *test/assert + ("aaa" test-c 'dict:test-c type?) test.assert ( symbol add

@@ -314,8 +314,8 @@ (a b concat @result return)

when ) ) :: - ("a" "b" add "ab" ==) *test/assert - ((1 2 3) (4 5) add (1 2 3 4 5) ==) *test/assert + ("a" "b" add "ab" ==) test.assert + ((1 2 3) (4 5) add (1 2 3 4 5) ==) test.assert (typeclass fiveplus

@@ -349,8 +349,31 @@ ) ::

6 test 11 test and - ) *test/assert + ) test.assert + + ( + {{1 :aa} :a 2 :b} :test1 + test1.b test1.a.aa + 3 == + ) test.assert + + ( + {} :obj + 3 :obj.three + 2 :obj.two + (obj.three 6 <) + ( + obj.three 1 + @obj.three + ) + while + obj.three 6 == + ) test.assert - *test/report - ; Tidy up + ( + {} :obj + (dup *) ^square + 3 obj.square 9 == + ) test.assert + + test.report + ;; Tidy up clear-stack
M tests/http.mintests/http.min

@@ -1,51 +1,51 @@

'min-test require :test ;;; -"http" *test/describe +"http" test.describe "postman-echo.com" :host "https://$1" (host) => % :url - ("$1/get" (url) => % get-content from-json /headers /user-agent "min http-module/$1" (version) => % ==) *test/assert + ("$1/get" (url) => % get-content from-json "headers" dget "user-agent" dget "min http-module/$1" (version) => % ==) test.assert - ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json /args /test "Hello!" ==) *test/assert + ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json "args" dget "test" dget "Hello!" ==) test.assert "tests/test1.json" rm ( {} ( - ("$1/get" (url) => % %url) - ("GET" %method) - ({"it-it" :Accept-Language} %headers) + ("$1/get" (url) => % "url" dset) + ("GET" "method" dset) + ({"it-it" :Accept-Language} "headers" dset) (request) - ) tap /body from-json /headers /accept-language "it-it" == - ) *test/assert + ) tap "body" dget from-json "headers" dget "accept-language" dget "it-it" == + ) test.assert ( {} ( - ("$1/put" (url) => % %url) - ("PUT" %method) - ({} to-json %body) + ("$1/put" (url) => % "url" dset) + ("PUT" "method" dset) + ({} to-json "body" dset) (request) - ) tap /body from-json /data {} == - ) *test/assert + ) tap "body" dget from-json "data" dget {} == + ) test.assert ( {} ( - ("$1/post" (url) => % %url) - ("POST" %method) - ({"post" :test} to-json %body) + ("$1/post" (url) => % "url" dset) + ("POST" "method" dset) + ({"post" :test} to-json "body" dset) (request) - ) tap /headers /content-type "^application/json" match? - ) *test/assert + ) tap "headers" dget "content-type" dget "^application/json" match? + ) test.assert ( {} ( - ("$1/patch" (url) => % %url) - ("PATCH" %method) - ({} to-json %body) + ("$1/patch" (url) => % "url" dset) + ("PATCH" "method" dset) + ({} to-json "body" dset) (request) - ) tap /body from-json /data {} == - ) *test/assert + ) tap "body" dget from-json "data" dget {} == + ) test.assert (

@@ -54,7 +54,7 @@ ("$1/delete" (url) => % "url" dset)

("DELETE" "method" dset) (request) ) tap "body" dget from-json "url" dget "https?:\\/\\/$1/delete" (host) => % match? - ) *test/assert + ) test.assert - *test/report + test.report clear-stack
M tests/io.mintests/io.min

@@ -1,14 +1,14 @@

'min-test require :test ;;; -"io" *test/describe +"io" test.describe ("TEST" "test.txt" fwrite - "test.txt" fread "TEST" ==) *test/assert + "test.txt" fread "TEST" ==) test.assert (" - TEST" "test.txt" fappend - "test.txt" fread "TEST - TEST" ==) *test/assert + "test.txt" fread "TEST - TEST" ==) test.assert "test.txt" rm - *test/report + test.report clear-stack
M tests/logic.mintests/logic.min

@@ -1,161 +1,161 @@

'min-test require :test ;;; -"logic" *test/describe +"logic" test.describe - (2 3 <) *test/assert - (3 2 < false ==) *test/assert - (3 3 < false ==) *test/assert - (2.99 3 <) *test/assert - (2 1.99 < false ==) *test/assert - (1.99 1.991 <) *test/assert - (1.99 1.990 < false ==) *test/assert - ("test1" "test2" <) *test/assert - ("test3" "test2" < false ==) *test/assert - ("test2" "test2" < false ==) *test/assert + (2 3 <) test.assert + (3 2 < false ==) test.assert + (3 3 < false ==) test.assert + (2.99 3 <) test.assert + (2 1.99 < false ==) test.assert + (1.99 1.991 <) test.assert + (1.99 1.990 < false ==) test.assert + ("test1" "test2" <) test.assert + ("test3" "test2" < false ==) test.assert + ("test2" "test2" < false ==) test.assert - (2 3 <=) *test/assert - (3 2 <= false ==) *test/assert - (3 3 <=) *test/assert - (2.99 3 <=) *test/assert - (2 1.99 <= false ==) *test/assert - (1.99 1.991 <=) *test/assert - (1.99 1.990 <=) *test/assert - ("test1" "test2" <=) *test/assert - ("test3" "test2" <= false ==) *test/assert - ("test2" "test2" <=) *test/assert + (2 3 <=) test.assert + (3 2 <= false ==) test.assert + (3 3 <=) test.assert + (2.99 3 <=) test.assert + (2 1.99 <= false ==) test.assert + (1.99 1.991 <=) test.assert + (1.99 1.990 <=) test.assert + ("test1" "test2" <=) test.assert + ("test3" "test2" <= false ==) test.assert + ("test2" "test2" <=) test.assert - (2 3 > false ==) *test/assert - (3 2 >) *test/assert - (3 3 > false ==) *test/assert - (2.99 3 > false ==) *test/assert - (2 1.99 >) *test/assert - (1.99 1.991 > false ==) *test/assert - (1.99 1.990 > false ==) *test/assert - ("test1" "test2" > false ==) *test/assert - ("test3" "test2" >) *test/assert - ("test2" "test2" > false ==) *test/assert + (2 3 > false ==) test.assert + (3 2 >) test.assert + (3 3 > false ==) test.assert + (2.99 3 > false ==) test.assert + (2 1.99 >) test.assert + (1.99 1.991 > false ==) test.assert + (1.99 1.990 > false ==) test.assert + ("test1" "test2" > false ==) test.assert + ("test3" "test2" >) test.assert + ("test2" "test2" > false ==) test.assert - (2 3 >= false ==) *test/assert - (3 2 >=) *test/assert - (3 3 >=) *test/assert - (2.99 3 >= false ==) *test/assert - (2 1.99 >=) *test/assert - (1.99 1.991 >= false ==) *test/assert - (1.99 1.990 >=) *test/assert - ("test1" "test2" >= false ==) *test/assert - ("test3" "test2" >=) *test/assert - ("test2" "test2" >=) *test/assert + (2 3 >= false ==) test.assert + (3 2 >=) test.assert + (3 3 >=) test.assert + (2.99 3 >= false ==) test.assert + (2 1.99 >=) test.assert + (1.99 1.991 >= false ==) test.assert + (1.99 1.990 >=) test.assert + ("test1" "test2" >= false ==) test.assert + ("test3" "test2" >=) test.assert + ("test2" "test2" >=) test.assert - (true true ==) *test/assert - (false true == false ==) *test/assert - (true false == false ==) *test/assert - (false false ==) *test/assert - (1 1 ==) *test/assert - ("aaa" "aaa" ==) *test/assert - (1.0 1 ==) *test/assert - ((1 2 3.0) (1.0 2 3) ==) *test/assert - (("a" "b") ("a" "b") ==) *test/assert - (("a" "b" 3) ("a" "b" 4) == false ==) *test/assert - ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) ==) *test/assert + (true true ==) test.assert + (false true == false ==) test.assert + (true false == false ==) test.assert + (false false ==) test.assert + (1 1 ==) test.assert + ("aaa" "aaa" ==) test.assert + (1.0 1 ==) test.assert + ((1 2 3.0) (1.0 2 3) ==) test.assert + (("a" "b") ("a" "b") ==) test.assert + (("a" "b" 3) ("a" "b" 4) == false ==) test.assert + ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) ==) test.assert - (true true != false ==) *test/assert - (false true !=) *test/assert - (true false !=) *test/assert - (false false != false ==) *test/assert - (1 1 != false ==) *test/assert - ("aaa" "aaa" != false ==) *test/assert - ;(1.0 1 != false ==) *test/assert - ;((1 2 3.0) (1.0 2.0 3) != false ==) *test/assert - ;(("a" "b") ("a" "b") != false ==) *test/assert - (("a" "b" 3) ("a" "b" 4) !=) *test/assert - ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) != false ==) *test/assert + (true true != false ==) test.assert + (false true !=) test.assert + (true false !=) test.assert + (false false != false ==) test.assert + (1 1 != false ==) test.assert + ("aaa" "aaa" != false ==) test.assert + ;;(1.0 1 != false ==) *test/assert + ;;((1 2 3.0) (1.0 2.0 3) != false ==) *test/assert + ;;(("a" "b") ("a" "b") != false ==) *test/assert + (("a" "b" 3) ("a" "b" 4) !=) test.assert + ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) != false ==) test.assert - (false not) *test/assert - (true not false ==) *test/assert + (false not) test.assert + (true not false ==) test.assert - (true true and) *test/assert - (true false and false ==) *test/assert - (false true and false ==) *test/assert - (false false and false ==) *test/assert + (true true and) test.assert + (true false and false ==) test.assert + (false true and false ==) test.assert + (false false and false ==) test.assert - (true true or) *test/assert - (true false or) *test/assert - (false true or) *test/assert - (false false or false ==) *test/assert + (true true or) test.assert + (true false or) test.assert + (false true or) test.assert + (false false or false ==) test.assert - (true true xor false ==) *test/assert - (true false xor) *test/assert - (false true xor) *test/assert - (false false xor false ==) *test/assert + (true true xor false ==) test.assert + (true false xor) test.assert + (false true xor) test.assert + (false false xor false ==) test.assert - ("a" string?) *test/assert - (1 string? false ==) *test/assert - (1.0 string? false ==) *test/assert - (true string? false ==) *test/assert - (false string? false ==) *test/assert - (("a" 2 c) string? false ==) *test/assert + ("a" string?) test.assert + (1 string? false ==) test.assert + (1.0 string? false ==) test.assert + (true string? false ==) test.assert + (false string? false ==) test.assert + (("a" 2 c) string? false ==) test.assert - ("a" integer? false ==) *test/assert - (1 integer?) *test/assert - (1.0 integer? false ==) *test/assert - (true integer? false ==) *test/assert - (false integer? false ==) *test/assert - (("a" 2 c) integer? false ==) *test/assert + ("a" integer? false ==) test.assert + (1 integer?) test.assert + (1.0 integer? false ==) test.assert + (true integer? false ==) test.assert + (false integer? false ==) test.assert + (("a" 2 c) integer? false ==) test.assert - ("a" float? false ==) *test/assert - (1 float? false ==) *test/assert - (1.0 float?) *test/assert - (true float? false ==) *test/assert - (false float? false ==) *test/assert - (("a" 2 c) float? false ==) *test/assert + ("a" float? false ==) test.assert + (1 float? false ==) test.assert + (1.0 float?) test.assert + (true float? false ==) test.assert + (false float? false ==) test.assert + (("a" 2 c) float? false ==) test.assert - ("a" boolean? false ==) *test/assert - (1 boolean? false ==) *test/assert - (1.0 boolean? false ==) *test/assert - (true boolean?) *test/assert - (false boolean?) *test/assert - (("a" 2 c) boolean? false ==) *test/assert + ("a" boolean? false ==) test.assert + (1 boolean? false ==) test.assert + (1.0 boolean? false ==) test.assert + (true boolean?) test.assert + (false boolean?) test.assert + (("a" 2 c) boolean? false ==) test.assert - ("a" number? false ==) *test/assert - (1 number?) *test/assert - (1.0 number?) *test/assert - (true number? false ==) *test/assert - (false number? false ==) *test/assert - (("a" 2 c) number? false ==) *test/assert + ("a" number? false ==) test.assert + (1 number?) test.assert + (1.0 number?) test.assert + (true number? false ==) test.assert + (false number? false ==) test.assert + (("a" 2 c) number? false ==) test.assert - ("a" quotation? false ==) *test/assert - (1 quotation? false ==) *test/assert - (1.0 quotation? false ==) *test/assert - (true quotation? false ==) *test/assert - (false quotation? false ==) *test/assert - (("a" 2 c) quotation?) *test/assert + ("a" quotation? false ==) test.assert + (1 quotation? false ==) test.assert + (1.0 quotation? false ==) test.assert + (true quotation? false ==) test.assert + (false quotation? false ==) test.assert + (("a" 2 c) quotation?) test.assert - ("a" stringlike?) *test/assert - (1 stringlike? false ==) *test/assert - ('test stringlike?) *test/assert + ("a" stringlike?) test.assert + (1 stringlike? false ==) test.assert + ('test stringlike?) test.assert - (("a") quoted-symbol? not) *test/assert - ('test quoted-symbol?) *test/assert - ((aaa bbb) quoted-symbol? not) *test/assert + (("a") quoted-symbol? not) test.assert + ('test quoted-symbol?) test.assert + ((aaa bbb) quoted-symbol? not) test.assert - ({} 'dict:module type? false ==) *test/assert - ((1 2 3) 'dict:module type? false ==) *test/assert - (4 'dict:module type? false ==) *test/assert - (logic 'dict:module type?) *test/assert - (1 "int" type?) *test/assert - ("test" "str" type?) *test/assert - (global "dict:module" type?) *test/assert + ({} 'dict:module type? false ==) test.assert + ((1 2 3) 'dict:module type? false ==) test.assert + (4 'dict:module type? false ==) test.assert + (logic 'dict:module type?) test.assert + (1 "int" type?) test.assert + ("test" "str" type?) test.assert + (global "dict:module" type?) test.assert - (7 0 / inf ==) *test/assert - (-7 0 / -inf ==) *test/assert - (0 0 / nan ==) *test/assert - (10 3 / 3.33333 ==) *test/assert + (7 0 / inf ==) test.assert + (-7 0 / -inf ==) test.assert + (0 0 / nan ==) test.assert + (10 3 / 3.33333 ==) test.assert - (3 "a" == not) *test/assert - (1 () != true) *test/assert - (3.3 'test == not) *test/assert + (3 "a" == not) test.assert + (1 () != true) test.assert + (3.3 'test == not) test.assert ( (

@@ -165,7 +165,7 @@ ("a" "b" ==)

("never printed" puts!) ) && false == - ) *test/assert + ) test.assert ( (

@@ -174,7 +174,7 @@ (2 1 <)

("a" "a" ==) ("never printed" puts!) ) || - ) *test/assert + ) test.assert - *test/report + test.report clear-stack
M tests/math.mintests/math.min

@@ -1,35 +1,35 @@

'min-test require :test ;;; -"math" *test/describe +"math" test.describe - (0 d2r sin 0 ==) *test/assert + (0 d2r sin 0 ==) test.assert - (30 d2r sin 0.5 ==) *test/assert + (30 d2r sin 0.5 ==) test.assert - (45 d2r sin 2 sqrt 2 / ==) *test/assert + (45 d2r sin 2 sqrt 2 / ==) test.assert - (60 d2r sin 3 sqrt 2 / ==) *test/assert + (60 d2r sin 3 sqrt 2 / ==) test.assert - (90 d2r sin 1 ==) *test/assert + (90 d2r sin 1 ==) test.assert - (15 d2r sin 75 d2r cos ==) *test/assert + (15 d2r sin 75 d2r cos ==) test.assert - (15 cos 2 pow 15 sin 2 pow + 1 ==) *test/assert + (15 cos 2 pow 15 sin 2 pow + 1 ==) test.assert - (pi 4 / tan 1 ==) *test/assert + (pi 4 / tan 1 ==) test.assert - (e 3 pow ln 3 ==) *test/assert + (e 3 pow ln 3 ==) test.assert - (pi floor 3 ==) *test/assert + (pi floor 3 ==) test.assert - (pi 2 round 3.14 ==) *test/assert + (pi 2 round 3.14 ==) test.assert - (pi ceil 4 ==) *test/assert + (pi ceil 4 ==) test.assert - (pi trunc 3 ==) *test/assert + (pi trunc 3 ==) test.assert - (-2.87 abs 2.87 ==) *test/assert + (-2.87 abs 2.87 ==) test.assert - *test/report + test.report clear-stack
M tests/net.mintests/net.min

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

'min-test require :test ;;; -"net" *test/describe +"net" test.describe {} socket :srv1 {} socket :srv2

@@ -23,14 +23,15 @@ (line "HTTP/1.1 200 OK" == not)

( cli1 recv-line @line (response line) => "\n" join puts @response - ) while + ) + while - (response "200 OK" match?) *test/assert + (response "200 OK" match?) test.assert - (srv1 srv2 ==) *test/assert - (cli1 cli2 !=) *test/assert + (srv1 srv2 ==) test.assert + (cli1 cli2 !=) test.assert - *test/report + test.report clear-stack srv1 close srv2 close
M tests/num.mintests/num.min

@@ -1,88 +1,88 @@

'min-test require :test ;;; -"num" *test/describe +"num" test.describe - (2 2 + 4 ==) *test/assert - (1 3.0 + 4 ==) *test/assert - (3.1 3.9 + 7 ==) *test/assert - (3 -2.1 + 0.8999999999999999 ==) *test/assert + (2 2 + 4 ==) test.assert + (1 3.0 + 4 ==) test.assert + (3.1 3.9 + 7 ==) test.assert + (3 -2.1 + 0.8999999999999999 ==) test.assert - (3 3 - 0 ==) *test/assert - (-5 -4 - -1 ==) *test/assert - (-4 3.7 - -7.7 ==) *test/assert + (3 3 - 0 ==) test.assert + (-5 -4 - -1 ==) test.assert + (-4 3.7 - -7.7 ==) test.assert - (-2 4 * -8 ==) *test/assert - (-2.5 -2 * 5 ==) *test/assert - (3 3 * 9 ==) *test/assert + (-2 4 * -8 ==) test.assert + (-2.5 -2 * 5 ==) test.assert + (3 3 * 9 ==) test.assert - (5 2 / 2.5 ==) *test/assert - (1 3 / 0.3333333333333333 ==) *test/assert - (-3 2 / -1.5 ==) *test/assert + (5 2 / 2.5 ==) test.assert + (1 3 / 0.3333333333333333 ==) test.assert + (-3 2 / -1.5 ==) test.assert - (5 2 div 2 ==) *test/assert - (1 3 div 0 ==) *test/assert - (-3 2 div -1 ==) *test/assert + (5 2 div 2 ==) test.assert + (1 3 div 0 ==) test.assert + (-3 2 div -1 ==) test.assert - (5 2 mod 1 ==) *test/assert - (4 2 mod 0 ==) *test/assert - (-3 2 mod -1 ==) *test/assert + (5 2 mod 1 ==) test.assert + (4 2 mod 0 ==) test.assert + (-3 2 mod -1 ==) test.assert - (1000 random 1000 <) *test/assert + (1000 random 1000 <) test.assert - ((1 2 3 4 5) sum 15 ==) *test/assert + ((1 2 3 4 5) sum 15 ==) test.assert - ((1 2 3 4 5) product 120 ==) *test/assert + ((1 2 3 4 5) product 120 ==) test.assert - ((1 2 3 4 5) avg 3.0 ==) *test/assert - ((1 2 3 4 5 6) avg 3.5 ==) *test/assert + ((1 2 3 4 5) avg 3.0 ==) test.assert + ((1 2 3 4 5 6) avg 3.5 ==) test.assert - ((1 3 5 7) med 4.0 ==) *test/assert - ((1 3 5 7 9) med 5 ==) *test/assert + ((1 3 5 7) med 4.0 ==) test.assert + ((1 3 5 7 9) med 5 ==) test.assert - ((1 5) range (1 2 3 4 5) ==) *test/assert - ((5 1) range (5 4 3 2 1) ==) *test/assert - ((4 7) range (4 5 6 7) ==) *test/assert - ((7 4) range (7 6 5 4) ==) *test/assert - ((1 6 2) range (1 3 5) ==) *test/assert - ((1 6 3) range (1 4) ==) *test/assert - ((0 6 2) range (0 2 4 6) ==) *test/assert - ((6 1 2) range (6 4 2) ==) *test/assert - ((6 1 3) range (6 3) ==) *test/assert - ((6 0 2) range (6 4 2 0) ==) *test/assert + ((1 5) range (1 2 3 4 5) ==) test.assert + ((5 1) range (5 4 3 2 1) ==) test.assert + ((4 7) range (4 5 6 7) ==) test.assert + ((7 4) range (7 6 5 4) ==) test.assert + ((1 6 2) range (1 3 5) ==) test.assert + ((1 6 3) range (1 4) ==) test.assert + ((0 6 2) range (0 2 4 6) ==) test.assert + ((6 1 2) range (6 4 2) ==) test.assert + ((6 1 3) range (6 3) ==) test.assert + ((6 0 2) range (6 4 2 0) ==) test.assert - (2 3 bitand 2 ==) *test/assert + (2 3 bitand 2 ==) test.assert - (123 bitnot -124 ==) *test/assert + (123 bitnot -124 ==) test.assert - (2 3 bitor 3 ==) *test/assert + (2 3 bitor 3 ==) test.assert - (2 3 bitxor 1 ==) *test/assert + (2 3 bitxor 1 ==) test.assert - (2 3 shl 16 ==) *test/assert + (2 3 shl 16 ==) test.assert - (16 3 shr 2 ==) *test/assert + (16 3 shr 2 ==) test.assert (0 :c - (c 10 <) (c succ @c) while - c 10 ==) *test/assert + (c 10 <) (c succ @c) while + c 10 ==) test.assert - ((1 2 3 4 5) (even?) filter (2 4) ==) *test/assert + ((1 2 3 4 5) (even?) filter (2 4) ==) test.assert - ((1 2 3 4 5) (even?) any?) *test/assert + ((1 2 3 4 5) (even?) any?) test.assert - ((2 4 6 8) (even?) all?) *test/assert + ((2 4 6 8) (even?) all?) test.assert - (base? "dec" ==) *test/assert - ('bin base "bin" base? == 'dec base) *test/assert - (0b10010 18 ==) *test/assert - (0b101010 0b010101 bitand 0b000000 ==) *test/assert - (0b101010 0b010101 bitor 0b111111 ==) *test/assert - (0b101010 0b010101 bitxor 0b111111 ==) *test/assert - (0b111000 (0 2) bitflip 0b111101 ==) *test/assert - (0b111001 (0) bitclear 0b111000 ==) *test/assert - (0b111000 (0 1) bitset 0b111011 ==) *test/assert - (0b111000 bitparity 1 ==) *test/assert + (base? "dec" ==) test.assert + ('bin base "bin" base? == 'dec base) test.assert + (0b10010 18 ==) test.assert + (0b101010 0b010101 bitand 0b000000 ==) test.assert + (0b101010 0b010101 bitor 0b111111 ==) test.assert + (0b101010 0b010101 bitxor 0b111111 ==) test.assert + (0b111000 (0 2) bitflip 0b111101 ==) test.assert + (0b111001 (0) bitclear 0b111000 ==) test.assert + (0b111000 (0 1) bitset 0b111011 ==) test.assert + (0b111000 bitparity 1 ==) test.assert - *test/report + test.report clear-stack
M tests/seq.mintests/seq.min

@@ -1,93 +1,93 @@

'min-test require :test ;;; -"seq" *test/describe +"seq" test.describe - ((1 2) (3 4) concat (1 2 3 4) ==) *test/assert + ((1 2) (3 4) concat (1 2 3 4) ==) test.assert - ((1 2 3) first 1 ==) *test/assert + ((1 2 3) first 1 ==) test.assert - ((1 2 3) last 3 ==) *test/assert + ((1 2 3) last 3 ==) test.assert - ((1 2 3) rest (2 3) ==) *test/assert + ((1 2 3) rest (2 3) ==) test.assert - (4 (1 2 3) append (1 2 3 4) ==) *test/assert + (4 (1 2 3) append (1 2 3 4) ==) test.assert - (0 (1 2 3) prepend (0 1 2 3) ==) *test/assert + (0 (1 2 3) prepend (0 1 2 3) ==) test.assert - ((1 2 3 4) 2 get 3 ==) *test/assert + ((1 2 3 4) 2 get 3 ==) test.assert - ((a b c) 1 get-raw /type "sym" ==) *test/assert + ((a b c) 1 get-raw "type" dget "sym" ==) test.assert - ((1 2 3 4) 222 2 set (1 2 222 4) ==) *test/assert + ((1 2 3 4) 222 2 set (1 2 222 4) ==) test.assert - ((1 2 3) "test" 1 set-sym (1 test 3) ==) *test/assert + ((1 2 3) "test" 1 set-sym (1 test 3) ==) test.assert - ((1 2 3 4) 2 remove (1 2 4) ==) *test/assert + ((1 2 3 4) 2 remove (1 2 4) ==) test.assert - ((1 2 3 4) 333 2 insert (1 2 333 3 4) ==) *test/assert + ((1 2 3 4) 333 2 insert (1 2 333 3 4) ==) test.assert - ((1 2 3) size 3 ==) *test/assert + ((1 2 3) size 3 ==) test.assert - ((1 2 3 4) 5 in? false ==) *test/assert + ((1 2 3 4) 5 in? false ==) test.assert - ((1 2 3 4) 2 in?) *test/assert + ((1 2 3 4) 2 in?) test.assert - ((1 2 3 4) (2 +) map (3 4 5 6) ==) *test/assert + ((1 2 3 4) (2 +) map (3 4 5 6) ==) test.assert - ((5 4 3 2 1) reverse (1 2 3 4 5) ==) *test/assert + ((5 4 3 2 1) reverse (1 2 3 4 5) ==) test.assert - ((3 4 7 2 4 6 5 6) '> sort (2 3 4 4 5 6 6 7) ==) *test/assert + ((3 4 7 2 4 6 5 6) '> sort (2 3 4 4 5 6 6 7) ==) test.assert - ((3 4 7 2 4 6 5 6) '< sort (7 6 6 5 4 4 3 2) ==) *test/assert + ((3 4 7 2 4 6 5 6) '< sort (7 6 6 5 4 4 3 2) ==) test.assert - ((1 2 3 4 5) 3 shorten (1 2 3) ==) *test/assert + ((1 2 3 4 5) 3 shorten (1 2 3) ==) test.assert - ((1 2 3 4 5) 3 take (1 2 3) ==) *test/assert + ((1 2 3 4 5) 3 take (1 2 3) ==) test.assert - ((1 2 3 4 5) 6 take (1 2 3 4 5) ==) *test/assert + ((1 2 3 4 5) 6 take (1 2 3 4 5) ==) test.assert - ((1 2 3 4 5) 3 drop (4 5) ==) *test/assert + ((1 2 3 4 5) 3 drop (4 5) ==) test.assert - ((1 2 3 4 5) 6 drop () ==) *test/assert + ((1 2 3 4 5) 6 drop () ==) test.assert - ((1 2 3 4 5) (2 >) find 2 ==) *test/assert + ((1 2 3 4 5) (2 >) find 2 ==) test.assert - ((1 2 3 4 5) 1 (*) reduce 120 ==) *test/assert + ((1 2 3 4 5) 1 (*) reduce 120 ==) test.assert - ((1 3 5) (dup *) (+) map-reduce 35 ==) *test/assert + ((1 3 5) (dup *) (+) map-reduce 35 ==) test.assert - ((1 2 3 4 5 6) (odd?) partition get-stack ((1 3 5) (2 4 6)) ==) *test/assert + ((1 2 3 4 5 6) (odd?) partition get-stack ((1 3 5) (2 4 6)) ==) test.assert - ((1 2 3 4 5 6) (odd?) reject (2 4 6) ==) *test/assert + ((1 2 3 4 5 6) (odd?) reject (2 4 6) ==) test.assert - ((1 2 3 4 5 6) 2 4 slice (3 4 5) ==) *test/assert + ((1 2 3 4 5 6) 2 4 slice (3 4 5) ==) test.assert - ((2 3 () 4 (3 4) () () "test") harvest (2 3 4 (3 4) "test") ==) *test/assert + ((2 3 () 4 (3 4) () () "test") harvest (2 3 4 (3 4) "test") ==) test.assert - ((1 2 3 (4 5 6) 7 (8 9)) flatten (1 2 3 4 5 6 7 8 9) ==) *test/assert + ((1 2 3 (4 5 6) 7 (8 9)) flatten (1 2 3 4 5 6 7 8 9) ==) test.assert - ((2 3 + 4 *) quote-map ('+ ==) find 2 ==) *test/assert + ((2 3 + 4 *) quote-map ('+ ==) find 2 ==) test.assert - ((2 4 6 8) 'even? all?) *test/assert + ((2 4 6 8) 'even? all?) test.assert - ((2 4 3 6 8) 'even? all? not) *test/assert + ((2 4 3 6 8) 'even? all? not) test.assert - ((1 2 3 4) 'odd? one? not) *test/assert + ((1 2 3 4) 'odd? one? not) test.assert - ((1 2 4) 'odd? one?) *test/assert + ((1 2 4) 'odd? one?) test.assert - ((1 2 3 4) 'odd? any?) *test/assert + ((1 2 3 4) 'odd? any?) test.assert - ((2 4 6 8) 'odd? any? not) *test/assert + ((2 4 6 8) 'odd? any? not) test.assert - ((1 2 "test") ("test" "a" true 1) intersection (1 "test") ==) *test/assert + ((1 2 "test") ("test" "a" true 1) intersection (1 "test") ==) test.assert - ((1 2 "test") ("test" "a" true 1) union (true 1 "test" "a" 2) ==) *test/assert + ((1 2 "test") ("test" "a" true 1) union (true 1 "test" "a" 2) ==) test.assert - ((1 2 "test") ("test" "a" true 1) difference (2) ==) *test/assert + ((1 2 "test") ("test" "a" true 1) difference (2) ==) test.assert - ((1 2 "test") ("test" "a" true 1) symmetric-difference (true "a" 2) ==) *test/assert + ((1 2 "test") ("test" "a" true 1) symmetric-difference (true "a" 2) ==) test.assert - *test/report + test.report clear-stack
M tests/stack.mintests/stack.min

@@ -1,37 +1,37 @@

'min-test require :test ;;; -"stack" *test/describe +"stack" test.describe - (1 2 3 4 get-stack (1 2 3 4) ==) *test/assert + (1 2 3 4 get-stack (1 2 3 4) ==) test.assert - ((1 2 3) set-stack get-stack (1 2 3) ==) *test/assert + ((1 2 3) set-stack get-stack (1 2 3) ==) test.assert - (1 id 1 ==) *test/assert + (1 id 1 ==) test.assert - (2 pop get-stack () ==) *test/assert + (2 pop get-stack () ==) test.assert - (1 dup get-stack (1 1) ==) *test/assert + (1 dup get-stack (1 1) ==) test.assert - (3 2 (1 +) dip + 6 ==) *test/assert + (3 2 (1 +) dip + 6 ==) test.assert - (1 2 nip get-stack (2) ==) *test/assert + (1 2 nip get-stack (2) ==) test.assert - (1 2 4 '+ dip get-stack (3 4) ==) *test/assert + (1 2 4 '+ dip get-stack (3 4) ==) test.assert - (1 2 4 '+ keep get-stack (1 6 4) ==) *test/assert + (1 2 4 '+ keep get-stack (1 6 4) ==) test.assert - ((1) (2 swap append) sip concat (1 2 1) ==) *test/assert + ((1) (2 swap append) sip concat (1 2 1) ==) test.assert - (1 (2 3) cons (1 2 3) ==) *test/assert + (1 (2 3) cons (1 2 3) ==) test.assert - (1 2 over get-stack (1 2 1) ==) *test/assert + (1 2 over get-stack (1 2 1) ==) test.assert - (1 2 3 pick get-stack (1 2 3 1) ==) *test/assert + (1 2 3 pick get-stack (1 2 3 1) ==) test.assert - ((1 2 3) ('sum 'size) => cleave / 2 ==) *test/assert + ((1 2 3) ('sum 'size) => cleave / 2 ==) test.assert - ((1 2) (3 4) ((0 get) (1 get)) spread get-stack (1 4) ==) *test/assert + ((1 2) (3 4) ((0 get) (1 get)) spread get-stack (1 4) ==) test.assert - *test/report + test.report clear-stack
M tests/str.mintests/str.min

@@ -1,92 +1,92 @@

'min-test require :test ;;; -"str" *test/describe +"str" test.describe - ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) *test/assert + ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) test.assert - ("$1 + $2 = $3" (2 2 (2 2 +)) apply interpolate "2 + 2 = 4" ==) *test/assert + ("$1 + $2 = $3" (2 2 (2 2 +)) apply interpolate "2 + 2 = 4" ==) test.assert - (" test " strip "test" ==) *test/assert + (" test " strip "test" ==) test.assert - ("test" length 4 ==) *test/assert + ("test" length 4 ==) test.assert - ("a,b,c" "," split ("a" "b" "c") ==) *test/assert + ("a,b,c" "," split ("a" "b" "c") ==) test.assert - ("abc" "" split ("a" "b" "c") ==) *test/assert + ("abc" "" split ("a" "b" "c") ==) test.assert - ("This is a test" 5 2 substr "is" ==) *test/assert + ("This is a test" 5 2 substr "is" ==) test.assert - ("this" 2 3 substr "is" ==) *test/assert + ("this" 2 3 substr "is" ==) test.assert - ("This is a test" "is" indexof 2 ==) *test/assert + ("This is a test" "is" indexof 2 ==) test.assert - ("test #1" "[0-9]" search ("1") ==) *test/assert + ("test #1" "[0-9]" search ("1") ==) test.assert - ("a" ord 97 ==) *test/assert + ("a" ord 97 ==) test.assert - (97 chr "a" ==) *test/assert + (97 chr "a" ==) test.assert - ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) *test/assert + ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) test.assert - ("This is a random string" "random" match?) *test/assert + ("This is a random string" "random" match?) test.assert - ("something is not something else" "some" "any" replace "anything is not anything else" ==) *test/assert + ("something is not something else" "some" "any" replace "anything is not anything else" ==) test.assert - ("MiN is a concatenative programming language" "(?i)^min" search ("MiN") ==) *test/assert + ("MiN is a concatenative programming language" "(?i)^min" search ("MiN") ==) test.assert - ("This is a difficult test" "difficult" "simple" replace "This is a simple test" ==) *test/assert + ("This is a difficult test" "difficult" "simple" replace "This is a simple test" ==) test.assert - ("This is a DIFFICULT\n test" "(?mi)difficult" "simple" replace "This is a simple\n test" ==) *test/assert + ("This is a DIFFICULT\n test" "(?mi)difficult" "simple" replace "This is a simple\n test" ==) test.assert - ("This is again another test" "(again|still|yet)" (1 get :m "_$#_" (m) =%) replace-apply "This is _again_ another test" ==) *test/assert + ("This is again another test" "(again|still|yet)" (1 get :m "_$#_" (m) =%) replace-apply "This is _again_ another test" ==) test.assert - ("/api/items/test-1" "\\/api\\/items\\/(.+)" search 1 get "test-1" ==) *test/assert + ("/api/items/test-1" "\\/api\\/items\\/(.+)" search 1 get "test-1" ==) test.assert - ("this is a test" uppercase "THIS IS A TEST" ==) *test/assert + ("this is a test" uppercase "THIS IS A TEST" ==) test.assert - ("THIS IS A TEST" lowercase "this is a test" ==) *test/assert + ("THIS IS A TEST" lowercase "this is a test" ==) test.assert - ("test" capitalize "Test" ==) *test/assert + ("test" capitalize "Test" ==) test.assert - ("this is a test" titleize "This Is A Test" ==) *test/assert + ("this is a test" titleize "This Is A Test" ==) test.assert - ("+" 3 repeat "+++" ==) *test/assert + ("+" 3 repeat "+++" ==) test.assert - ("test" 4 indent " test" ==) *test/assert + ("test" 4 indent " test" ==) test.assert - ((1 3 "test") ", " join "1, 3, test" ==) *test/assert + ((1 3 "test") ", " join "1, 3, test" ==) test.assert - ("PWD: $pwd" ("pwd" .) =% ("PWD: " .) => "" join ==) *test/assert + ("PWD: $pwd" ("pwd" pwd) =% ("PWD: " pwd) => "" join ==) test.assert - ("1.2.3" from-semver {1 :major 2 :minor 3 :patch} ==) *test/assert + ("1.2.3" from-semver {1 :major 2 :minor 3 :patch} ==) test.assert - ({2 :major 25 :minor 300 :patch} to-semver "2.25.300" ==) *test/assert + ({2 :major 25 :minor 300 :patch} to-semver "2.25.300" ==) test.assert - ("2.3.6" semver-inc-major "3.0.0" ==) *test/assert + ("2.3.6" semver-inc-major "3.0.0" ==) test.assert - ("2.3.6" semver-inc-minor "2.4.0" ==) *test/assert + ("2.3.6" semver-inc-minor "2.4.0" ==) test.assert - ("2.3.6" semver-inc-patch "2.3.7" ==) *test/assert + ("2.3.6" semver-inc-patch "2.3.7" ==) test.assert - ("4.6.5" semver? true ==) *test/assert + ("4.6.5" semver? true ==) test.assert - ("4.6.5.3" semver? false ==) *test/assert + ("4.6.5.3" semver? false ==) test.assert - ("fix" "pre" prefix "prefix" ==) *test/assert + ("fix" "pre" prefix "prefix" ==) test.assert - ("suf" "fix" suffix "suffix" ==) *test/assert + ("suf" "fix" suffix "suffix" ==) test.assert - ("http://test.com?€%,,!{}" encode-url "http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" ==) *test/assert + ("http://test.com?€%,,!{}" encode-url "http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" ==) test.assert - ("http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" decode-url "http://test.com?€%,,!{}" ==) *test/assert + ("http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" decode-url "http://test.com?€%,,!{}" ==) test.assert - ("http://h3rald.com/a/b/c?test=1#123" parse-url {"123" :anchor "h3rald.com" :hostname "" :password "/a/b/c" :path "" :port "test=1" :query "http" :scheme "" :username} ==) *test/assert + ("http://h3rald.com/a/b/c?test=1#123" parse-url {"123" :anchor "h3rald.com" :hostname "" :password "/a/b/c" :path "" :port "test=1" :query "http" :scheme "" :username} ==) test.assert - ("0b00101101" dup from-bin to-bin ==) *test/assert - ("0x00FF0000" dup from-hex to-hex ==) *test/assert - ("0o00007473" dup from-oct to-oct ==) *test/assert - ("123" dup from-dec to-dec ==) *test/assert + ("0b00101101" dup from-bin to-bin ==) test.assert + ("0x00FF0000" dup from-hex to-hex ==) test.assert + ("0o00007473" dup from-oct to-oct ==) test.assert + ("123" dup from-dec to-dec ==) test.assert - *test/report + test.report clear-stack
M tests/sys.mintests/sys.min

@@ -1,70 +1,70 @@

'min-test require :test ;;; -"sys" *test/describe +"sys" test.describe - ("dir1" mkdir "dir1" dir?) *test/assert + ("dir1" mkdir "dir1" dir?) test.assert - ("dir1" "dir2" mv "dir2" dir?) *test/assert + ("dir1" "dir2" mv "dir2" dir?) test.assert - ("dir1" dir? false ==) *test/assert + ("dir1" dir? false ==) test.assert - ("dir2" "dir1" cp "dir1" dir?) *test/assert + ("dir2" "dir1" cp "dir1" dir?) test.assert - ("..." "dir1/test.txt" fwrite "dir1/test.txt" file?) *test/assert + ("..." "dir1/test.txt" fwrite "dir1/test.txt" file?) test.assert - ("dir1/test.txt" "dir2" mv "dir2/test.txt" file?) *test/assert + ("dir1/test.txt" "dir2" mv "dir2/test.txt" file?) test.assert - ("dir1/test.txt" file? false ==) *test/assert + ("dir1/test.txt" file? false ==) test.assert - ("dir2/test.txt" "dir1" cp "dir1/test.txt" file?) *test/assert + ("dir2/test.txt" "dir1" cp "dir1/test.txt" file?) test.assert - ('dir1 ls 'filename map ("test.txt") ==) *test/assert + ('dir1 ls 'filename map ("test.txt") ==) test.assert - ('dir2 ls 'dirname map ("dir2") ==) *test/assert + ('dir2 ls 'dirname map ("dir2") ==) test.assert - ('dir1 rmdir 'dir2 rmdir 'dir1 dir? 'dir2 dir? or false ==) *test/assert + ('dir1 rmdir 'dir2 rmdir 'dir1 dir? 'dir2 dir? or false ==) test.assert - ("systest" mkdir . ls (. "systest") => "/" join in?) *test/assert + ("systest" mkdir pwd ls (pwd "systest") => "/" join in?) test.assert - ("systest" cd . "systest" match?) *test/assert - .. cd + ("systest" cd pwd "systest" match?) test.assert + parent-dir cd - ("./min -v" & 'output dget "\." match?) *test/assert + ("./min -v" run 'output dget "\\." match?) test.assert - ("PATH" env?) *test/assert + ("PATH" env?) test.assert - ($PATH length 0 >) *test/assert + ($PATH length 0 >) test.assert - ("TEST" "AAA" put-env $AAA "TEST" ==) *test/assert + ("TEST" "AAA" put-env $AAA "TEST" ==) test.assert - (os length 0 >) *test/assert + (os length 0 >) test.assert - (cpu length 0 >) *test/assert + (cpu length 0 >) test.assert - ("TEST" "test.txt" fwrite "test.txt" file?) *test/assert + ("TEST" "test.txt" fwrite "test.txt" file?) test.assert - ("test.txt" "test2.txt" cp "test2.txt" file?) *test/assert + ("test.txt" "test2.txt" cp "test2.txt" file?) test.assert - ("test.txt" "test1.txt" mv "test1.txt" file?) *test/assert + ("test.txt" "test1.txt" mv "test1.txt" file?) test.assert - ("test2.txt" rm "test1.txt" rm . ls (. "test1.txt") => "/" join in? :t1 . ls "test2" in? t1 and false ==) *test/assert + ("test2.txt" rm "test1.txt" rm pwd ls (pwd "test1.txt") => "/" join in? :t1 pwd ls "test2" in? t1 and false ==) test.assert ("systest" cd "TEST" "test.txt" fwrite "TEST1" "test1.txt" fwrite "TEST2" "test2.txt" fwrite "TEST3" "test3.txt" fwrite - . ls "test.zip" zip . ls (. "test.zip") => "/" join in?) *test/assert + pwd ls "test.zip" zip pwd ls (pwd "test.zip") => "/" join in?) test.assert - ("test.zip" "extracted" unzip "extracted" ls "extracted/test1.txt" in?) *test/assert + ("test.zip" "extracted" unzip "extracted" ls "extracted/test1.txt" in?) test.assert - .. cd + parent-dir cd - ("systest" rmdir . ls (. "systest") => "/" join in? false ==) *test/assert + ("systest" rmdir pwd ls (pwd "systest") => "/" join in? false ==) test.assert - ([ls] &ls /output ==) *test/assert + ([ls] "ls" run "output" dget ==) test.assert - *test/report + test.report clear-stack "systest" rmdir
M tests/time.mintests/time.min

@@ -1,21 +1,21 @@

'min-test require :test ;;; -"time" *test/describe +"time" test.describe - (timestamp 1464951736 >) *test/assert + (timestamp 1464951736 >) test.assert - (now 1464951736 >) *test/assert + (now 1464951736 >) test.assert - (1464951736 datetime "2016-06-03T11:02:16Z" ==) *test/assert + (1464951736 datetime "2016-06-03T11:02:16Z" ==) test.assert - (1464951736 "yy-MM-dd" tformat "16-06-03" ==) *test/assert + (1464951736 "yy-MM-dd" tformat "16-06-03" ==) test.assert - (1464951736 timeinfo to-timestamp 1464951736 ==) *test/assert + (1464951736 timeinfo to-timestamp 1464951736 ==) test.assert - (1464951736 timeinfo 'second dget 16 ==) *test/assert + (1464951736 timeinfo 'second dget 16 ==) test.assert - (1464951736 timeinfo 'timezone dget integer?) *test/assert + (1464951736 timeinfo 'timezone dget integer?) test.assert - *test/report + test.report clear-stack
M tests/xml.mintests/xml.min

@@ -2,38 +2,51 @@ 'min-test require :test

;;; -"xml" *test/describe +"xml" test.describe - ("test" xentity /text "test" ==) *test/assert + ("test" xentity "text" dget "test" ==) test.assert - ("test" xcomment /text "test" ==) *test/assert + ("test" xcomment "text" dget "test" ==) test.assert - ("test" xtext /text "test" ==) *test/assert + ("test" xtext "text" dget "test" ==) test.assert - ("test" xcdata /text "test" ==) *test/assert + ("test" xcdata "text" dget "test" ==) test.assert - ("test" xelement /tag "test" ==) *test/assert + ("test" xelement "tag" dget "test" ==) test.assert ( "test" xelement :xnode - xnode {"a" :attr1} %attributes @xnode + xnode {"a" :attr1} "attributes" dset @xnode "a1" xelement :child "text..." xtext :text - xnode (child text) => %children @xnode + xnode (child text) => "children" dset @xnode xnode to-xml - "<test attr1=\"a\"><a1 />text...</test>" == ) *test/assert + "<test attr1=\"a\"><a1 />text...</test>" == ) test.assert ( "<ul><li class='test'>yes</li><li class='test'>...</li><li>no</li></ul>" from-xml :xnode xnode "li.test" xquery - /children first /text "yes" == - ) *test/assert + "children" dget first "text" dget "yes" == + ) test.assert ( "<ul><li class='test'>yes</li><li class='test'>...</li><li>no</li></ul>" from-xml :xnode xnode "li.test" xqueryall size 2 == - ) *test/assert + ) test.assert + + ( + "<b>this is a test</b><img src='test.jpg'><i>&copy</i>" from-html :xnode + xnode to-xml "<document>\n <b>this is a test</b>\n <img src=\"test.jpg\" />\n <i>&amp;copy</i>\n</document>" == + ) test.assert + + ( + "&gt;" xentity xentity2utf8 ">" == + ) test.assert + + ( + "This is a <i>test</i>" xescape "This is a &lt;i&gt;test&lt;/i&gt;" == + ) test.assert - *test/report + test.report clear-stack