all repos — min @ 31b735c766a19d6c61e48acb5fa826cacc33c7a4

A small but practical concatenative programming language.

Implemented integrated help system.
h3rald h3rald@h3rald.com
Sat, 23 Jan 2021 16:24:55 +0000
commit

31b735c766a19d6c61e48acb5fa826cacc33c7a4

parent

aaf8faf94be598853620113b86935f24364be419

M .gitignore.gitignore

@@ -16,7 +16,6 @@ site/temp/

dynlibs/ .env.yml response.json -run -run.nim -dstore.json +mintool +mintool.nim test.min
A build_mintool

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

+min -c -m:tasks -a:tasks/data -n:'-d:release' mintool
M help.jsonhelp.json

@@ -1,2170 +1,2322 @@

{ - "crypto": { + "operators": { + "!": { + "description": "See system", + "kind": "symbol", + "name": "!" + }, + "!!": { + "description": "See system!", + "kind": "symbol", + "name": "!!" + }, + "!=": { + "description": "Returns true if a1 is not equal to a2, false otherwise.", + "kind": "symbol", + "name": "!=", + "signature": "a1 a2 ==> bool" + }, + "#": { + "description": "See quote-bind", + "kind": "symbol", + "name": "#" + }, + "$": { + "description": "See get-env", + "kind": "symbol", + "name": "$" + }, + "%": { + "description": "See interpolate", + "kind": "symbol", + "name": "%" + }, + "&": { + "description": "See run", + "kind": "symbol", + "name": "&" + }, + "'": { + "description": "See quote", + "kind": "symbol", + "name": "'" + }, + "*": { + "description": "Multiplies num1 by num2.", + "kind": "symbol", + "name": "*", + "signature": "num1 num2 ==> num3" + }, + "+": { + "description": "Sums num1 and num2.", + "kind": "symbol", + "name": "+", + "signature": "num1 num2 ==> num3" + }, + "-": { + "description": "Subtracts num2 from num1.", + "kind": "symbol", + "name": "-", + "signature": "num1 num2 ==> num3" + }, + "-inf": { + "description": "Returns negative infinity.", + "kind": "symbol", + "name": "-inf", + "signature": " ==> num" + }, + ".": { + "description": "Returns the full path to the current directory.", + "kind": "symbol", + "name": ".", + "signature": " ==> string" + }, + "..": { + "description": "Returns the full path to the parent directory.", + "kind": "symbol", + "name": "..", + "signature": " ==> string" + }, + "/": { + "description": "Divides num1 by num2.", + "kind": "symbol", + "name": "/", + "signature": "num1 num2 ==> num3" + }, + ":": { + "description": "See define", + "kind": "symbol", + "name": ":" + }, + "::": { + "description": "See operator", + "kind": "symbol", + "name": "::" + }, + "<": { + "description": "Returns true if a1 is smaller than a2, false otherwise. \n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "kind": "symbol", + "name": "<", + "signature": "a1 a2 ==> bool" + }, + "<=": { + "description": "Returns true if a1 is smaller than or equal to a2, false otherwise.\n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "kind": "symbol", + "name": "<=", + "signature": "a1 a2 ==> bool" + }, + "=": { + "description": "See quote-define", + "kind": "symbol", + "name": "=" + }, + "=%": { + "description": "See apply-interpolate", + "kind": "symbol", + "name": "=%" + }, + "=-=": { + "description": "See expect-empty-stack", + "kind": "symbol", + "name": "=-=" + }, + "==": { + "description": "Returns true if a1 is equal to a2, false otherwise.", + "kind": "symbol", + "name": "==", + "signature": "a1 a2 ==> bool" + }, + "==>": { + "description": "Symbol used to separate input and output calues in operator signatures.", + "kind": "symbol", + "name": "==>", + "signature": " ==> " + }, + "=>": { + "description": "See apply", + "kind": "symbol", + "name": "=>" + }, + "=~": { + "description": "See regex", + "kind": "symbol", + "name": "=~" + }, + ">": { + "description": "Returns true if a1 is greater than a2, false otherwise. \n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "kind": "symbol", + "name": ">", + "signature": "a1 a2 ==> bool" + }, + "><": { + "description": "See infix-dequote", + "kind": "symbol", + "name": "><" + }, + ">=": { + "description": "Returns true if a1 is greater than or equal to a2, false otherwise.\n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "kind": "symbol", + "name": ">=", + "signature": "a1 a2 ==> bool" + }, + ">>": { + "description": "See prefix-dequote", + "kind": "symbol", + "name": ">>" + }, + "?": { + "description": "See help", + "kind": "symbol", + "name": "?" + }, + "@": { + "description": "See bind", + "kind": "symbol", + "name": "@" + }, + "ROOT": { + "description": "Returns a module holding a reference to the [ROOT](class:kwd) scope.\n\n \n Tip\n \n This symbol is very useful in conjunction with the **with** operator.", + "kind": "symbol", + "name": "ROOT", + "signature": " ==> dict" + }, + "^": { + "description": "See call", + "kind": "symbol", + "name": "^" + }, + "abs": { + "description": "Calculates tbe absolute value of num1.", + "kind": "symbol", + "name": "abs", + "signature": "num1 ==> num2" + }, + "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", + "name": "accept", + "signature": "dict:socket1 dict:socket2 ==> dict:socket1" + }, + "acos": { + "description": "Calculates the arc cosine of num1 (in radians).", + "kind": "symbol", + "name": "acos", + "signature": "num1 ==> num2" + }, "aes": { "description": "Encrypts or decrypts 'sym1 using the Advanced Encryption Standard (AES) in CTR mode, using 'sym2 as password.", - "input": "'sym1 'sym2", + "kind": "symbol", "name": "aes", - "output": "string" + "signature": "'sym1 'sym2 ==> string" }, - "decode": { - "description": "Decodes the Base64-encoded string 'sym.", - "input": "'sym", - "name": "decode", - "output": "string" + "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", + "name": "all?", + "signature": "quot1 quot2 ==> bool" }, - "encode": { - "description": "Base64-encodes 'sym.", - "input": "'sym", - "name": "encode", - "output": "string" + "and": { + "description": "Returns true if bool1 is equal to bool2, false otherwise.", + "kind": "symbol", + "name": "and", + "signature": "bool1 bool2 ==> bool3" }, - "md4": { - "description": "Returns the MD4 hash of 'sym.", - "input": "'sym", - "name": "md4", - "output": "string" + "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", + "name": "any?", + "signature": "quot1 quot2 ==> bool" + }, + "append": { + "description": "Returns a new quotation containing the contents of quot with a appended.", + "kind": "symbol", + "name": "append", + "signature": "a quot ==> (a* a)" + }, + "apply-interpolate": { + "description": "The same as pushing apply and then interpolate on the stack.", + "kind": "symbol", + "name": "apply-interpolate", + "signature": "string quot ==> string" + }, + "args": { + "description": "Returns a list of all arguments passed to the current program.", + "kind": "symbol", + "name": "args", + "signature": " ==> quot" + }, + "asin": { + "description": "Calculates the arc sine of num1 (in radians).", + "kind": "symbol", + "name": "asin", + "signature": "num1 ==> num2" + }, + "ask": { + "description": "Prints string1 (prompt), reads a line from STDIN and places it on top of the stack as a string.", + "kind": "symbol", + "name": "ask", + "signature": "string1 ==> string2" + }, + "atan": { + "description": "Calculates the arc tangent of num1 (in radians).", + "kind": "symbol", + "name": "atan", + "signature": "num1 ==> num2" + }, + "atime": { + "description": "Returns a timestamp corresponding to the time that file/directory 'sym was last accessed.", + "kind": "symbol", + "name": "atime", + "signature": "'sym ==> float" + }, + "avg": { + "description": "Returns the average of the items of quot.", + "kind": "symbol", + "name": "avg", + "signature": "quot ==> num" + }, + "bind": { + "description": "Binds the specified value (auto-quoted) to an existing symbol 'sym.", + "kind": "symbol", + "name": "bind", + "signature": "a 'sym ==> " + }, + "bitand": { + "description": "Computes the bitwise *and* of numbers int1 and int2.", + "kind": "symbol", + "name": "bitand", + "signature": "int1 int2 ==> int3" + }, + "bitnot": { + "description": "Computes the bitwise *complement* of int1.", + "kind": "symbol", + "name": "bitnot", + "signature": "int1 ==> int2" + }, + "bitor": { + "description": "Computes the bitwise *or* of numbers int1 and int2.", + "kind": "symbol", + "name": "bitor", + "signature": "int1 int2 ==> int3" + }, + "bitxor": { + "description": "Computes the bitwise *xor* of numbers int1 and int2.", + "kind": "symbol", + "name": "bitxor", + "signature": "int1 int2 ==> int3" + }, + "bool": { + "description": "Converts a to a boolean value based on the following rules:\n \n * If a is a boolean value, no conversion is performed.\n * If a is null, it is converted to false .\n * If a is a numeric value, zero is converted to false , otherwise it is converted to true.\n * If a is a quotation or a dictionary, the empty quotation or dictionary is converted to false , otherwise it is converted to true.\n * If a is a string, the empty string, and \"false\" are converted to false , otherwise it is converted to true.", + "kind": "symbol", + "name": "bool", + "signature": "a ==> bool" + }, + "boolean?": { + "description": "Returns true if a is a boolean, false otherwise.", + "kind": "symbol", + "name": "boolean?", + "signature": "a ==> bool" + }, + "call": { + "description": "Calls operator 'sym defined in dictionary dict.", + "kind": "symbol", + "name": "call", + "signature": "dict 'sym ==> a*" + }, + "capitalize": { + "description": "Returns a copy of 'sym with the first character capitalized.", + "kind": "symbol", + "name": "capitalize", + "signature": "'sym ==> string" + }, + "case": { + "description": "This operator takes a quotation containing _n_ different conditional branches. \n \n Each branch must be a quotation containing two quotations, and it is processed as follows:\n \n * if quot1 evaluates to true, then the quot2 is executed.\n * if quot1 evaluates to false , then the following branch is processed (if any).\n \n \n Example\n \n The following program prints \"Smaller than 3\":\n \n 2 (\n (( 3) (\"Greater than 3\" put!))\n ((< 3) (\"Smaller than 3\" put!))\n ((true) (\"Exactly 3\" put!))\n ) case", + "kind": "symbol", + "name": "case", + "signature": "((quot1 quot2)*) ==> a*" + }, + "cd": { + "description": "Change the current directory to 'sym.", + "kind": "symbol", + "name": "cd", + "signature": "'sym ==> " + }, + "ceil": { + "description": "Returns the smallest integer int that is not smaller than num.", + "kind": "symbol", + "name": "ceil", + "signature": "num ==> int" + }, + "chmod": { + "description": "Sets the permissions of file or directory 'sym to int. int is a three-digit representation of user, group and other permissions. See the [Unix Permissions Calculator](http://permissions-calculator.org/) for examples and conversions.\n \n \n Example\n \n The following program makes the file **/tmp/test.txt** readable, writable and executable by its owner, and readable and executable by users of the same group and all other users:\n \n /tmp/test.txt 755 chmod", + "kind": "symbol", + "name": "chmod", + "signature": "'sym int ==> " + }, + "choose": { + "description": "Prints string2, then prints all string1 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", + "name": "choose", + "signature": "((string1 quot1)+) string2 ==> a*" + }, + "chr": { + "description": "Returns the single character string obtained by interpreting int as an ASCII code.", + "kind": "symbol", + "name": "chr", + "signature": "int ==> string" + }, + "clear": { + "description": "Clears the screen.", + "kind": "symbol", + "name": "clear", + "signature": " ==> " + }, + "clear-stack": { + "description": "Empties the stack.", + "kind": "symbol", + "name": "clear-stack", + "signature": "a ==> " + }, + "cleave": { + "description": "Applies each quotation contained in the first element to the second element a1.\n \n Example\n \n The following program leaves 2 on the stack:\n \n (1 2 3) ((sum) (size)) cleave /", + "kind": "symbol", + "name": "cleave", + "signature": "a1 (quot*) ==> a*" + }, + "close": { + "description": "Closes a previously-opened socket.", + "kind": "symbol", + "name": "close", + "signature": "dict:socket ==> " + }, + "column-print": { + "description": "Prints all elements of quot to STDOUT, in int columns.", + "kind": "symbol", + "name": "column-print", + "signature": "quot int ==> a" }, - "md5": { - "description": "Returns the MD5 hash of 'sym.", - "input": "'sym", - "name": "md5", - "output": "string" + "compiled?": { + "description": "Returns true if the current program has been compiled.", + "kind": "symbol", + "name": "compiled?", + "signature": " ==> bool" + }, + "concat": { + "description": "Concatenates quot1 with quot2.", + "kind": "symbol", + "name": "concat", + "signature": "quot1 quot2 ==> quot3" + }, + "confirm": { + "description": "Prints string (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", + "name": "confirm", + "signature": "string ==> bool" + }, + "connect": { + "description": "Connects socket dict:socket to address string 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", + "name": "connect", + "signature": "dict:socket string int ==> dict:socket" + }, + "cons": { + "description": "Prepends a1 to the quotation on top of the stack.", + "kind": "symbol", + "name": "cons", + "signature": "a1 (a*) ==> (a1 a*)" + }, + "cos": { + "description": "Calculates the cosine of num1 (in radians).", + "kind": "symbol", + "name": "cos", + "signature": "num1 ==> num2" + }, + "cosh": { + "description": "Calculates the hyperbolic cosine of num1 (in radians).", + "kind": "symbol", + "name": "cosh", + "signature": "num1 ==> num2" + }, + "cp": { + "description": "Copies the file or directory 'sym1 to 'sym2.", + "kind": "symbol", + "name": "cp", + "signature": "'sym1 'sym2 ==> " }, - "sha1": { - "description": "Returns the SHA1 hash of 'sym.", - "input": "'sym", - "name": "sha1", - "output": "string" + "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", + "name": "cpu", + "signature": " ==> string" }, - "sha224": { - "description": "Returns the SHA224 hash of 'sym.", - "input": "'sym", - "name": "sha224", - "output": "string" + "ctime": { + "description": "Returns a timestamp corresponding to the time that file/directory 'sym was created.", + "kind": "symbol", + "name": "ctime", + "signature": "'sym ==> float" }, - "sha256": { - "description": "Returns the SHA256 hash of 'sym.", - "input": "'sym", - "name": "sha256", - "output": "string" + "d2r": { + "description": "Converts num1 from degrees to radians.", + "kind": "symbol", + "name": "d2r", + "signature": "num1 ==> num2" }, - "sha384": { - "description": "Returns the SHA384 hash of 'sym.", - "input": "'sym", - "name": "sha384", - "output": "string" + "datetime": { + "description": "Returns an ISO 8601 string representing the combined date and time in UTC of timestamp int.", + "kind": "symbol", + "name": "datetime", + "signature": "int ==> string" }, - "sha512": { - "description": "Returns the SHA512 hash of 'sym.", - "input": "'sym", - "name": "sha512", - "output": "string" - } - }, - "dict": { "ddel": { "description": "Removes 'sym from dict1 and returns dict1.", - "input": "dict 'sym", + "kind": "symbol", "name": "ddel", - "output": "dict" + "signature": "dict 'sym ==> dict" }, "ddup": { "description": "Returns a copy of dict1.", - "input": "dict1", + "kind": "symbol", "name": "ddup", - "output": "dict2" + "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", + "name": "debug", + "signature": "a ==> a" + }, + "debug!": { + "description": "Prints a (removing it from the stack) and a new line to STDOUT, if logging level is set to [debug](class:kwd) or lower.", + "kind": "symbol", + "name": "debug!", + "signature": "a ==> " + }, + "decode": { + "description": "Decodes the Base64-encoded string 'sym.", + "kind": "symbol", + "name": "decode", + "signature": "'sym ==> string" + }, + "define": { + "description": "Defines a new symbol 'sym, containing the specified value (auto-quoted if not already a quotation).", + "kind": "symbol", + "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", + "name": "define-sigil", + "signature": "a 'sym ==> " + }, + "defined-sigil?": { + "description": "Returns true if the symbol 'sym is defined, false otherwise.", + "kind": "symbol", + "name": "defined-sigil?", + "signature": "'sym ==> bool" + }, + "defined?": { + "description": "Returns true if the symbol 'sym is defined, false otherwise.", + "kind": "symbol", + "name": "defined?", + "signature": "'sym ==> bool" + }, + "delete": { + "description": "Deletes the specified symbol 'sym.", + "kind": "symbol", + "name": "delete", + "signature": "'sym ==> " + }, + "delete-sigil": { + "description": "Deletes the specified user-defined sigil 'sym.", + "kind": "symbol", + "name": "delete-sigil", + "signature": "'sym ==> " + }, + "dequote": { + "description": "Pushes the contents of quotation quot on the stack.\n\n Each element is pushed on the stack one by one. If any error occurs, quot is restored on the stack.", + "kind": "symbol", + "name": "dequote", + "signature": "quot ==> a*" }, "dget": { "description": "Returns the value of key 'sym from dictionary dict.", - "input": "dict 'sym", + "kind": "symbol", "name": "dget", - "output": "a" + "signature": "dict 'sym ==> a" }, "dhas?": { "description": "Returns true if dictionary dict contains the key 'sym, false otherwise.\n \n \n Example\n \n The following program returns true:\n \n {true :a1 \"aaa\" :a2 false :a3} 'a2 dhas?", - "input": "dict 'sym", + "kind": "symbol", "name": "dhas?", - "output": "bool" + "signature": "dict 'sym ==> bool" + }, + "dictionary?": { + "description": "Returns true if a is a dictionary, false otherwise.", + "kind": "symbol", + "name": "dictionary?", + "signature": "a ==> bool" + }, + "difference": { + "description": "Calculates the difference quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (2) on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) difference", + "kind": "symbol", + "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", + "name": "dip", + "signature": "a1 (a2) ==> a* a1" + }, + "dir?": { + "description": "Returns true if the specified path 'sym exists and is a directory.", + "kind": "symbol", + "name": "dir?", + "signature": "'sym ==> bool" + }, + "dirname": { + "description": "Returns the path of the directory containing path 'sym.", + "kind": "symbol", + "name": "dirname", + "signature": "'sym ==> string" + }, + "div": { + "description": "Divides int1 by int2 (integer division).", + "kind": "symbol", + "name": "div", + "signature": "int1 int2 ==> int3" }, "dkeys": { "description": "Returns a quotation containing all the keys of dictionary dict.", - "input": "dict", + "kind": "symbol", "name": "dkeys", - "output": "(string*)" + "signature": "dict ==> (string*)" + }, + "download": { + "description": "Downloads the contents of URL string1 to the local file string2.", + "kind": "symbol", + "name": "download", + "signature": "string1 string2 ==> " }, "dpairs": { "description": "Returns a quotation containing all the keys (odd items) and values (even items) of dictiionary dict.", - "input": "dict", + "kind": "symbol", "name": "dpairs", - "output": "(a*)" + "signature": "dict ==> (a*)" }, "dpick": { "description": "Returns a new dictionary dict2 containing the elements of dict1 whose keys are included in quot.\n \n \n Example\n \n The following program returns {4 :a 7 :d}:\n \n {5 :q 4 :a 6 :c 7 :d \"d\" :a} (\"a\" \"d\") dpick", - "input": "dict1 quot", + "kind": "symbol", "name": "dpick", - "output": "dict2" - }, - "dset": { - "description": "Sets the value of the 'sym of dict1 to a, and returns the modified dictionary dict.", - "input": "dict a 'sym", - "name": "dset", - "output": "dict" + "signature": "dict1 quot ==> dict2" }, - "dtype": { - "description": "Returns a string set to the type of dict (empty if the dictionary has no type).", - "input": "dict", - "name": "dtype", - "output": "string" + "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", + "name": "drop", + "signature": "quot1 int ==> quot2" }, - "dvalues": { - "description": "Returns a quotation containing all the values of dictionary dict.", - "input": "dict", - "name": "dvalues", - "output": "(a*)" - } - }, - "dstore": { "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.", - "input": "dict:datastore 'sym", + "kind": "symbol", "name": "dsdelete", - "output": "dict:datastore" + "signature": "dict:datastore 'sym ==> dict:datastore" }, "dsdelete!": { "description": "Same as dsdelete, but doesn't leave anything on the stack.", - "input": "dict:datastore 'sym", + "kind": "symbol", "name": "dsdelete!", - "output": "" + "signature": "dict:datastore 'sym ==> " + }, + "dset": { + "description": "Sets the value of the 'sym of dict1 to a, and returns the modified dictionary dict.", + "kind": "symbol", + "name": "dset", + "signature": "dict a '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 (/).", - "input": "dict:datastore 'sym", + "kind": "symbol", "name": "dsget", - "output": "dict" + "signature": "dict:datastore 'sym ==> dict" }, "dsinit": { "description": "Initializes a bew datastore by creating the 'sym JSON file. Puts the datastore instance on the stack.", - "input": "'sym", + "kind": "symbol", "name": "dsinit", - "output": "dict:datastore" + "signature": "'sym ==> dict:datastore" }, "dsinit!": { "description": "Same as dsinit, but doesn't leave anything on the stack.", - "input": "'sym dict", + "kind": "symbol", "name": "dsinit!", - "output": "" + "signature": "'sym dict ==> " }, "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.", - "input": "dict:datastore 'sym dict", + "kind": "symbol", "name": "dspost", - "output": "dict:datastore" + "signature": "dict:datastore 'sym dict ==> dict:datastore" }, "dspost!": { "description": "Same as dspost, but doesn't leave anything on the stack.", - "input": "dict:datastore 'sym dict", + "kind": "symbol", "name": "dspost!", - "output": "" + "signature": "dict:datastore 'sym dict ==> " }, "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.", - "input": "dict:datastore 'sym dict", + "kind": "symbol", "name": "dsput", - "output": "dict:datastore" + "signature": "dict:datastore 'sym dict ==> dict:datastore" }, "dsput!": { "description": "Same as dsput, but doesn't leave anything on the stack.", - "input": "dict:datastore 'sym", + "kind": "symbol", "name": "dsput!", - "output": "" + "signature": "dict:datastore 'sym ==> " }, "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", - "input": "dict:datastore 'sym quot", + "kind": "symbol", "name": "dsquery", - "output": "(dict*)" + "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.", - "input": "'sym", + "kind": "symbol", "name": "dsread", - "output": "dict:datastore" + "signature": "'sym ==> dict:datastore" }, "dswrite": { "description": "Writes the contents of the datastore dict:datastore to the filesystem.", - "input": "dict:datastore", + "kind": "symbol", "name": "dswrite", - "output": "dict:datastore" + "signature": "dict:datastore ==> dict:datastore" }, "dswrite!": { "description": "Same as dswrite, but doesn't leave anything on the stack.", - "input": "dict:datastore", + "kind": "symbol", "name": "dswrite!", - "output": "" - } - }, - "fs": { - "atime": { - "description": "Returns a timestamp corresponding to the time that file/directory 'sym was last accessed.", - "input": "'sym", - "name": "atime", - "output": "float" - }, - "ctime": { - "description": "Returns a timestamp corresponding to the time that file/directory 'sym was created.", - "input": "'sym", - "name": "ctime", - "output": "float" - }, - "fperms": { - "description": "Returns the Unix permissions (expressed as a three-digit number) of file/directory 'sym.", - "input": "'sym", - "name": "fperms", - "output": "int" - }, - "fsize": { - "description": "Returns the size in bytes of file/directory 'sym.", - "input": "'sym", - "name": "fsize", - "output": "int" - }, - "fstats": { - "description": "Returns a dictionary dict containing information on file/directory 'sym.\n \n Example\n \n Assuming that min is a file, the following:\n \n \"min\" fstats\n \n produces:\n \n {\n \"min\" :name\n 16777220 :device\n 50112479 :file\n \"file\" :type\n 617068 :size\n 755 :permissions\n 1 :nlinks\n 1496583112.0 :ctime\n 1496584370.0 :atime\n 1496583112.0 :mtime\n }", - "input": "'sym", - "name": "fstats", - "output": "dict" - }, - "ftype": { - "description": "Returns the type of file/directory 'sym (\"file\" or \"dir\").", - "input": "'sym", - "name": "ftype", - "output": "string" - }, - "hidden?": { - "description": "Returns true if file/directory 'sym is hidden, false otherwise.", - "input": "'sym", - "name": "hidden?", - "output": "bool" - }, - "mtime": { - "description": "Returns a timestamp corresponding to the time that file/directory 'sym was last modified.", - "input": "'sym", - "name": "mtime", - "output": "float" - } - }, - "http": { - "download": { - "description": "Downloads the contents of URL string1 to the local file string2.", - "input": "string1 string2", - "name": "download", - "output": "" - }, - "get-content": { - "description": "Retrieves the contents of URL string1 as string2.", - "input": "string1", - "name": "get-content", - "output": "string2" - }, - "request": { - "description": "Performs an HTTP request.\n \n \n Example\n \n The following code constructs a request dictionary 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", - "input": "request", - "name": "request", - "output": "response" - }, - "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: [request &rArr; 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", - "input": "dict", - "name": "start-server", - "output": "" + "signature": "dict:datastore ==> " }, - "stop-server": { - "description": "Stops the currently-running HTTP server. This operator should be used within an HTTP server handler quotation.", - "input": "", - "name": "stop-server", - "output": "" - } - }, - "io": { - "ask": { - "description": "Prints string1 (prompt), reads a line from STDIN and places it on top of the stack as a string.", - "input": "string1", - "name": "ask", - "output": "string2" + "dtype": { + "description": "Returns a string set to the type of dict (empty if the dictionary has no type).", + "kind": "symbol", + "name": "dtype", + "signature": "dict ==> string" }, - "choose": { - "description": "Prints string2, then prints all string1 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.", - "input": "((string1 quot1)+) string2", - "name": "choose", - "output": "a*" + "dup": { + "description": "Duplicates the first element on the stack.", + "kind": "symbol", + "name": "dup", + "signature": "a1 ==> a1 a1" }, - "clear": { - "description": "Clears the screen.", - "input": "", - "name": "clear", - "output": "" + "dvalues": { + "description": "Returns a quotation containing all the values of dictionary dict.", + "kind": "symbol", + "name": "dvalues", + "signature": "dict ==> (a*)" }, - "column-print": { - "description": "Prints all elements of quot to STDOUT, in int columns.", - "input": "quot int", - "name": "column-print", - "output": "a" + "e": { + "description": "Returns the value of the _e_ constant (Euler's number).", + "kind": "symbol", + "name": "e", + "signature": " ==> num" }, - "confirm": { - "description": "Prints string (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.", - "input": "string", - "name": "confirm", - "output": "bool" + "encode": { + "description": "Base64-encodes 'sym.", + "kind": "symbol", + "name": "encode", + "signature": "'sym ==> string" }, - "debug": { - "description": "Prints a and a new line to STDOUT, if logging level is set to [debug](class:kwd) or lower.", - "input": "a", - "name": "debug", - "output": "a" - }, - "debug!": { - "description": "Prints a (removing it from the stack) and a new line to STDOUT, if logging level is set to [debug](class:kwd) or lower.", - "input": "a", - "name": "debug!", - "output": "" + "env?": { + "description": "Returns true if environment variable 'sym exists, false otherwise.", + "kind": "symbol", + "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.", - "input": "a", + "kind": "symbol", "name": "error", - "output": "a" + "signature": "a ==> a" }, "error!": { "description": "Prints a (removing it from the stack) and a new line to STDERR, if logging level is set to [error](class:kwd) or lower.", - "input": "a", + "kind": "symbol", "name": "error!", - "output": "" - }, - "fappend": { - "description": "Appends string1 to the end of file string2.", - "input": "string1 string2", - "name": "fappend", - "output": "" - }, - "fatal": { - "description": "Prints a and a new line to STDERR, and exists the program with error code 100.", - "input": "a", - "name": "fatal", - "output": "a" - }, - "fread": { - "description": "Reads the file string and puts its contents on the top of the stack as a string.", - "input": "string", - "name": "fread", - "output": "string" - }, - "fwrite": { - "description": "Writes string1 to the file string2, erasing all its contents first.", - "input": "string1 string2", - "name": "fwrite", - "output": "" - }, - "getchr": { - "description": "Reads single character from STDIN without waiting for ENTER key and places its ASCII code on top of the stack.", - "input": "", - "name": "getchr", - "output": "int" - }, - "info": { - "description": "Prints a and a new line to STDOUT, if logging level is set to [info](class:kwd) or lower.", - "input": "a", - "name": "info", - "output": "a" - }, - "info!": { - "description": "Prints a (removing it from the stack) and a new line to STDOUT, if logging level is set to [info](class:kwd) or lower.", - "input": "a", - "name": "info!", - "output": "" - }, - "mapkey": { - "description": "Maps the named key/key combination 'sym to the quotation quot, so that quot is executed when key 'sym is pressed. \n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * The quotation will be executed by a copy of the min interpreter created when the mapping was defined. In other words, quotations executed by key bindings will not affect the current stack.\n \n \n Example\n \n The following program:\n \n (clear) 'ctrl+l keymap\n \n causes the CTRL+L key to clear the screen.", - "input": "quot 'sym", - "name": "mapkey", - "output": "" - }, - "newline": { - "description": "Prints a new line to STDOUT.", - "input": "", - "name": "newline", - "output": "" - }, - "notice": { - "description": "Prints a and a new line to STDOUT, if logging level is set to [notice](class:kwd) (default) or lower.", - "input": "a", - "name": "notice", - "output": "a" - }, - "notice!": { - "description": "Prints a (removing it from the stack) and a new line to STDOUT, if logging level is set to [notice](class:kwd) (default) or lower.", - "input": "a", - "name": "notice!", - "output": "" - }, - "password": { - "description": "Reads a line from STDIN displaying \\* for each typed character, and places it on top of the stack as a string.", - "input": "", - "name": "password", - "output": "string" - }, - "print": { - "description": "Prints a to STDOUT.", - "input": "a", - "name": "print", - "output": "a" - }, - "print!": { - "description": "Prints a to STDOUT and removes a from the stack.", - "input": "a", - "name": "print!", - "output": "" - }, - "putchr": { - "description": "Prints string to STDOUT without printing a new line (string must contain only one character).", - "input": "string", - "name": "putchr", - "output": "a" + "signature": "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.", - "input": "a", - "name": "type", - "output": "string" - }, - "unmapkey": { - "description": "Unmaps a previously-mapped key or key-combination 'sym, restoring the default mapping if available.\n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * At present, all the default mappings of min are those provided by the [nimline](https://h3rald.com/nimline/nimline.html) library.", - "input": "'sym", - "name": "unmapkey", - "output": "" - }, - "warning": { - "description": "Prints a and a new line to STDERR, if logging level is set to [warning](class:kwd) or lower.", - "input": "a", - "name": "warning", - "output": "a" - }, - "warning!": { - "description": "Prints a (removing it from the stack) and a new line to STDERR, if logging level is set to [warning](class:kwd) or lower.", - "input": "a", - "name": "warning!", - "output": "" - } - }, - "lang": { - "==": { - "description": "Symbol used to separate input and output calues in operator signatures.", - "input": "", - "name": "==", - "output": "" - }, - "ROOT": { - "description": "Returns a module holding a reference to the [ROOT](class:kwd) scope.\n\n \n Tip\n \n This symbol is very useful in conjunction with the **with** operator.", - "input": "", - "name": "ROOT", - "output": "dict" - }, - "args": { - "description": "Returns a list of all arguments passed to the current program.", - "input": "", - "name": "args", - "output": "quot" - }, - "bind": { - "description": "Binds the specified value (auto-quoted) to an existing symbol 'sym.", - "input": "a 'sym", - "name": "bind", - "output": "" - }, - "bool": { - "description": "Converts a to a boolean value based on the following rules:\n \n * If a is a boolean value, no conversion is performed.\n * If a is null, it is converted to false .\n * If a is a numeric value, zero is converted to false , otherwise it is converted to true.\n * If a is a quotation or a dictionary, the empty quotation or dictionary is converted to false , otherwise it is converted to true.\n * If a is a string, the empty string, and \"false\" are converted to false , otherwise it is converted to true.", - "input": "a", - "name": "bool", - "output": "bool" - }, - "call": { - "description": "Calls operator 'sym defined in dictionary dict.", - "input": "dict 'sym", - "name": "call", - "output": "a*" - }, - "case": { - "description": "This operator takes a quotation containing _n_ different conditional branches. \n \n Each branch must be a quotation containing two quotations, and it is processed as follows:\n \n * if quot1 evaluates to true, then the quot2 is executed.\n * if quot1 evaluates to false , then the following branch is processed (if any).\n \n \n Example\n \n The following program prints \"Smaller than 3\":\n \n 2 (\n (( 3) (\"Greater than 3\" put!))\n ((< 3) (\"Smaller than 3\" put!))\n ((true) (\"Exactly 3\" put!))\n ) case", - "input": "((quot1 quot2)*)", - "name": "case", - "output": "a*" - }, - "compiled?": { - "description": "Returns true if the current program has been compiled.", - "input": "", - "name": "compiled?", - "output": "bool" - }, - "define": { - "description": "Defines a new symbol 'sym, containing the specified value (auto-quoted if not already a quotation).", - "input": "a 'sym", - "name": "define", - "output": "" - }, - "define-sigil": { - "description": "Defines a new sigil 'sym, containing the specified value (auto-quoted if not already a quotation).", - "input": "a 'sym", - "name": "define-sigil", - "output": "" - }, - "defined-sigil?": { - "description": "Returns true if the symbol 'sym is defined, false otherwise.", - "input": "'sym", - "name": "defined-sigil?", - "output": "bool" - }, - "defined?": { - "description": "Returns true if the symbol 'sym is defined, false otherwise.", - "input": "'sym", - "name": "defined?", - "output": "bool" - }, - "delete": { - "description": "Deletes the specified symbol 'sym.", - "input": "'sym", - "name": "delete", - "output": "" - }, - "delete-sigil": { - "description": "Deletes the specified user-defined sigil 'sym.", - "input": "'sym", - "name": "delete-sigil", - "output": "" - }, - "dequote": { - "description": "Pushes the contents of quotation quot on the stack.\n\n Each element is pushed on the stack one by one. If any error occurs, quot is restored on the stack.", - "input": "quot", - "name": "dequote", - "output": "a*" + "escape": { + "description": "Returns a copy of 'sym with quotes and backslashes escaped with a backslash.", + "kind": "symbol", + "name": "escape", + "signature": "'sym ==> string" }, "eval": { "description": "Parses and interprets string.", - "input": "string", + "kind": "symbol", "name": "eval", - "output": "a*" + "signature": "string ==> a*" + }, + "even?": { + "description": "Returns true if int is even, false otherwise.", + "kind": "symbol", + "name": "even?", + "signature": "int ==> bool" + }, + "exists?": { + "description": "Returns true if the specified file or directory 'sym exists.", + "kind": "symbol", + "name": "exists?", + "signature": "'sym ==> bool" }, "exit": { "description": "Exits the program or shell with int as return code.", - "input": "int", + "kind": "symbol", "name": "exit", - "output": "" + "signature": "int ==> " }, "expect": { "description": "Validates the first _n_ elements of the stack against the type descriptions specified in quot1 (_n_ is quot1's length) and if all the elements are valid returns them wrapped in quot2 (in reverse order). \n\n \n Tips\n \n * You can specify a typed dictionary by prepending the type name with dict:. Example: dict:socket\n * You can specify two or more matching types by separating the type names with a pipe: 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) ==", - "input": "quot1", + "kind": "symbol", "name": "expect", - "output": "quot2" + "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", + "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", + "name": "expect-any", + "signature": "quot ==> bool" }, "expect-empty-stack": { "description": "Raises an error if the stack is not empty.", - "input": "", + "kind": "symbol", "name": "expect-empty-stack", - "output": "" + "signature": " ==> " + }, + "fappend": { + "description": "Appends string1 to the end of file string2.", + "kind": "symbol", + "name": "fappend", + "signature": "string1 string2 ==> " + }, + "fatal": { + "description": "Prints a and a new line to STDERR, and exists the program with error code 100.", + "kind": "symbol", + "name": "fatal", + "signature": "a ==> a" + }, + "file?": { + "description": "Returns true if the specified path 'sym exists and is a file.", + "kind": "symbol", + "name": "file?", + "signature": "'sym ==> bool" + }, + "filename": { + "description": "Returns the file name of path 'sym.", + "kind": "symbol", + "name": "filename", + "signature": "'sym ==> string" + }, + "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", + "name": "filter", + "signature": "quot1 quot2 ==> quot3" + }, + "find": { + "description": "Returns the index of the first element within quot1 that satisfies predicate quot2, or -1 if no element satisfies it.\n \n \n Example\n \n The following program leaves 3 on the stack:\n \n (1 2 4 8 16) \n (5 ) find", + "kind": "symbol", + "name": "find", + "signature": "quot1 quot2 ==> int" + }, + "first": { + "description": "Returns the first element of quot.", + "kind": "symbol", + "name": "first", + "signature": "quot ==> a" + }, + "flatten": { + "description": "Flattens all quotations within quot1 and returns the resulting sequence quot2.\n \n \n Example\n \n The following program leaves (1 2 3 4 5 6 7 8) on the stack:\n \n (1 (2 3 4) 5 (6 7) 8) \n flatten", + "kind": "symbol", + "name": "flatten", + "signature": "quot1 ==> quot2" }, "float": { "description": "Converts a to an integer 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.", - "input": "a", + "kind": "symbol", "name": "float", - "output": "float" + "signature": "a ==> float" + }, + "float?": { + "description": "Returns true if a is a float, false otherwise.", + "kind": "symbol", + "name": "float?", + "signature": "a ==> bool" + }, + "floor": { + "description": "Returns the largest integer int that is not greater than num.", + "kind": "symbol", + "name": "floor", + "signature": "num ==> int" }, "foreach": { "description": "Applies the quotation quot2 to each element of quot1.", - "input": "quot1 quot2", + "kind": "symbol", "name": "foreach", - "output": "a*" + "signature": "quot1 quot2 ==> a*" }, "format-error": { "description": "Formats the error dict:error as a string. \n \n Example\n \n The following: \n \n {\"MyError\" :error \"This is a test error\" :message} 'error set-type format-error\n \n produces: \"This is a test error\"", - "input": "dict:error", + "kind": "symbol", "name": "format-error", - "output": "string" + "signature": "dict:error ==> string" + }, + "fperms": { + "description": "Returns the Unix permissions (expressed as a three-digit number) of file/directory 'sym.", + "kind": "symbol", + "name": "fperms", + "signature": "'sym ==> int" + }, + "fread": { + "description": "Reads the file string and puts its contents on the top of the stack as a string.", + "kind": "symbol", + "name": "fread", + "signature": "string ==> string" }, "from-json": { "description": "Converts a JSON string into min data.", - "input": "string", + "kind": "symbol", "name": "from-json", - "output": "a" + "signature": "string ==> a" + }, + "from-semver": { + "description": "Given a basic [SemVer](https://semver.org)-compliant string (with no additional labels) string, \nit pushes a dictionary dict on the stack containing a **major**, **minor**, and **patch** key/value pairs.", + "kind": "symbol", + "name": "from-semver", + "signature": "string ==> dict" }, "from-yaml": { "description": "Converts a YAML string into min data.\n \n Note\n \n At present, only YAML objects containing string values are supported.", - "input": "string", + "kind": "symbol", "name": "from-yaml", - "output": "a" + "signature": "string ==> a" + }, + "fsize": { + "description": "Returns the size in bytes of file/directory 'sym.", + "kind": "symbol", + "name": "fsize", + "signature": "'sym ==> int" + }, + "fstats": { + "description": "Returns a dictionary dict containing information on file/directory 'sym.\n \n Example\n \n Assuming that min is a file, the following:\n \n \"min\" fstats\n \n produces:\n \n {\n \"min\" :name\n 16777220 :device\n 50112479 :file\n \"file\" :type\n 617068 :size\n 755 :permissions\n 1 :nlinks\n 1496583112.0 :ctime\n 1496584370.0 :atime\n 1496583112.0 :mtime\n }", + "kind": "symbol", + "name": "fstats", + "signature": "'sym ==> dict" + }, + "ftype": { + "description": "Returns the type of file/directory 'sym (\"file\" or \"dir\").", + "kind": "symbol", + "name": "ftype", + "signature": "'sym ==> string" + }, + "fwrite": { + "description": "Writes string1 to the file string2, erasing all its contents first.", + "kind": "symbol", + "name": "fwrite", + "signature": "string1 string2 ==> " + }, + "get": { + "description": "Returns the _n^th_ element of quot (zero-based).", + "kind": "symbol", + "name": "get", + "signature": "quot int ==> a" + }, + "get-content": { + "description": "Retrieves the contents of URL string1 as string2.", + "kind": "symbol", + "name": "get-content", + "signature": "string1 ==> string2" + }, + "get-env": { + "description": "Returns environment variable 'sym.", + "kind": "symbol", + "name": "get-env", + "signature": "'sym ==> string" + }, + "get-stack": { + "description": "Puts a quotation containing the contents of the stack on the stack.", + "kind": "symbol", + "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", + "name": "getchr", + "signature": " ==> int" }, "gets": { "description": "Reads a line from STDIN and places it on top of the stack as a string.", - "input": "", + "kind": "symbol", "name": "gets", - "output": "string" + "signature": " ==> string" + }, + "hardlink": { + "description": "Creates hardlink 'sym2 for file or directory 'sym1.", + "kind": "symbol", + "name": "hardlink", + "signature": "'sym1 'sym2 ==> " + }, + "harvest": { + "description": "Creates a new quotation quot2 containing all elements of quot1 except for empty quotations.\n \n \n Example\n \n The following program leaves (1 2 3) on the stack:\n \n (1 () () () 2 () 3) \n harvest", + "kind": "symbol", + "name": "harvest", + "signature": "quot1 ==> quot2" }, "help": { "description": "Prints the help text for 'sym, if available.", - "input": "'sym", + "kind": "symbol", "name": "help", - "output": "" + "signature": "'sym ==> " + }, + "hidden?": { + "description": "Returns true if file/directory 'sym is hidden, false otherwise.", + "kind": "symbol", + "name": "hidden?", + "signature": "'sym ==> bool" + }, + "id": { + "description": "Does nothing.", + "kind": "symbol", + "name": "id", + "signature": " ==> " }, "if": { "description": "If quot1 evaluates to true then evaluates quot2, otherwise evaluates quot3.", - "input": "quot1 quot2 quot3", + "kind": "symbol", "name": "if", - "output": "a*" + "signature": "quot1 quot2 quot3 ==> a*" }, "import": { "description": "Imports the a previously-loaded module 'sym, defining all its symbols in the current scope.", - "input": "'sym", + "kind": "symbol", "name": "import", - "output": "" + "signature": "'sym ==> " + }, + "in?": { + "description": "Returns true if a is contained in quot, false otherwise.", + "kind": "symbol", + "name": "in?", + "signature": "quot a ==> bool" + }, + "indent": { + "description": "Returns string containing 'sym indented with int spaces.", + "kind": "symbol", + "name": "indent", + "signature": "'sym int ==> string" + }, + "indexof": { + "description": "If string2 is contained in string1, returns the index of the first match or -1 if no match is found.", + "kind": "symbol", + "name": "indexof", + "signature": "string1 string2 ==> int" + }, + "inf": { + "description": "Returns infinity.", + "kind": "symbol", + "name": "inf", + "signature": " ==> num" }, "infix-dequote": { "description": "Dequotes quot using infix notation. \n \n Note that no special operator preference is defined, symbols precedence is always left-to-right. However, you can use parentheses (quotes) to evaluate expressions before others.\n \n \n Example\n \n The following program leaves 17 on the stack:\n\n (2 + (3 * 5)) infix-dequote\n\n while this program leaves 25 on the stack:\n \n (2 + 3 * 5) infix-dequote", - "input": "quot", + "kind": "symbol", "name": "infix-dequote", - "output": "a" + "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", + "name": "info", + "signature": "a ==> a" + }, + "info!": { + "description": "Prints a (removing it from the stack) and a new line to STDOUT, if logging level is set to [info](class:kwd) or lower.", + "kind": "symbol", + "name": "info!", + "signature": "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", + "name": "insert", + "signature": "quot1 a int ==> quot2" }, "int": { "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.", - "input": "a", + "kind": "symbol", "name": "int", - "output": "int" + "signature": "a ==> int" + }, + "integer?": { + "description": "Returns true if a is an integer, false otherwise.", + "kind": "symbol", + "name": "integer?", + "signature": "a ==> bool" + }, + "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", + "name": "intersection", + "signature": "quot1 quot2 ==> quot3" }, "invoke": { "description": "Assming that 'sym is a formatted like *dictionary*/*symbol*, calls *symbol* defined in *dictionary* (note that this also works for nested dictionaries. \n \n \n Example\n \n The following program leaves 100 on the stack:\n \n {{100 :b} :a} :test *test/a/b", - "input": "'sym", + "kind": "symbol", "name": "invoke", - "output": "a*" + "signature": "'sym ==> a*" + }, + "join": { + "description": "Joins the elements of quot using separator 'sym, producing string.", + "kind": "symbol", + "name": "join", + "signature": "quot 'sym ==> string" + }, + "keep": { + "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\n \n Example\n \n The following program leaves 5 3 on the stack:\n \n 2 3 '+ keep", + "kind": "symbol", + "name": "keep", + "signature": "a1 quot ==> a* a1" + }, + "last": { + "description": "Returns the last element of quot.", + "kind": "symbol", + "name": "last", + "signature": "quot ==> a" + }, + "length": { + "description": "Returns the length of 'sym.", + "kind": "symbol", + "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.", - "input": "", + "kind": "symbol", "name": "line-info", - "output": "dict" + "signature": " ==> dict" }, "linrec": { "description": "Implements linear recursions as follows:\n \n 1. Evaluates quot1.\n * If quot1 evaluates to true, then it evaluates quot2.\n * Otherwises it executes quot3 and recurses using the same four quotations.\n 2. Finally, it executes quot4.\n \n \n Example\n \n The following program leaves 120 on the stack, the factorial of 5:\n \n 5 (dup 0 ==) 'succ (dup pred) '* linrec", - "input": "quot1 quot2 quot3 quot4", + "kind": "symbol", "name": "linrec", - "output": "a*" + "signature": "quot1 quot2 quot3 quot4 ==> a*" }, "lite?": { "description": "Returns true if min was built in _lite_ mode.", - "input": "", + "kind": "symbol", "name": "lite?", - "output": "bool" + "signature": " ==> bool" + }, + "ln": { + "description": "Calculates the natural logarithm of num1.", + "kind": "symbol", + "name": "ln", + "signature": "num1 ==> num2" }, "load": { "description": "Parses and interprets the specified min file 'sym, adding [.min](class:ext) if not specified.", - "input": "'sym", + "kind": "symbol", "name": "load", - "output": "a*" + "signature": "'sym ==> a*" }, "load-symbol": { "description": "Loads the contents of symbol 'sym from the [.min\\_symbols](class:file) file.", - "input": "'sym", + "kind": "symbol", "name": "load-symbol", - "output": "a*" + "signature": "'sym ==> a*" + }, + "log10": { + "description": "Calculates the common logarithm of num1.", + "kind": "symbol", + "name": "log10", + "signature": "num1 ==> num2" + }, + "log2": { + "description": "Calculates the binary logarithm of num1.", + "kind": "symbol", + "name": "log2", + "signature": "num1 ==> num2" }, "loglevel": { "description": "Sets the current logging level to 'sym. 'sym must be one of the following strings or quoted symbols:\n \n * debug\n * info\n * notice\n * warn\n * error\n * fatal\n \n \n Note\n \n The default logging level is _notice_.", - "input": "'sym", + "kind": "symbol", "name": "loglevel", - "output": "" + "signature": "'sym ==> " }, "loglevel?": { "description": "Returns the current log level (debug, info, notive, warn, error or fatal).", - "input": "", + "kind": "symbol", "name": "loglevel?", - "output": "string" + "signature": " ==> string" + }, + "lowercase": { + "description": "Returns a copy of 'sym converted to lowercase.", + "kind": "symbol", + "name": "lowercase", + "signature": "'sym ==> string" + }, + "ls": { + "description": "Returns a quotation quot containing all children (files and directories) of the directory 'sym.", + "kind": "symbol", + "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", + "name": "ls-r", + "signature": "'sym ==> quot" + }, + "map": { + "description": "Returns a new quotation quot3 obtained by applying quot2 to each element of quot1.", + "kind": "symbol", + "name": "map", + "signature": "quot1 quot2 ==> quot3" + }, + "map-reduce": { + "description": "Applies quot2 (map) to each element of quot1 and then applies quot3 (reduce) to each successive element of quot1. quot1 must have at least one element.\n \n \n Example\n \n The following program leaves 35 on the stack:\n \n (1 3 5) \n (dup *) (+) map-reduce", + "kind": "symbol", + "name": "map-reduce", + "signature": "quot1 quot2 quot3 ==> int" + }, + "mapkey": { + "description": "Maps the named key/key combination 'sym to the quotation quot, so that quot is executed when key 'sym is pressed. \n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * The quotation will be executed by a copy of the min interpreter created when the mapping was defined. In other words, quotations executed by key bindings will not affect the current stack.\n \n \n Example\n \n The following program:\n \n (clear) 'ctrl+l keymap\n \n causes the CTRL+L key to clear the screen.", + "kind": "symbol", + "name": "mapkey", + "signature": "quot 'sym ==> " + }, + "match": { + "description": "Returns true if string2 matches string1, false otherwise.\n \n Tip\n \n string2 can be a sgregex-compatible regular expression.", + "kind": "symbol", + "name": "match", + "signature": "string1 string2 ==> bool" + }, + "md4": { + "description": "Returns the MD4 hash of 'sym.", + "kind": "symbol", + "name": "md4", + "signature": "'sym ==> string" + }, + "md5": { + "description": "Returns the MD5 hash of 'sym.", + "kind": "symbol", + "name": "md5", + "signature": "'sym ==> string" + }, + "med": { + "description": "Returns the median of the items of quot.", + "kind": "symbol", + "name": "med", + "signature": "quot ==> num" + }, + "mkdir": { + "description": "Creates the specified directory 'sym.", + "kind": "symbol", + "name": "mkdir", + "signature": "'sym ==> " + }, + "mod": { + "description": "Returns the integer module of int1 divided by int2.", + "kind": "symbol", + "name": "mod", + "signature": "int1 int2 ==> int3" }, "module": { "description": "Creates a new module 'sym based on dictionary dict.", - "input": "dict 'sym", + "kind": "symbol", "name": "module", - "output": "" + "signature": "dict 'sym ==> " + }, + "mtime": { + "description": "Returns a timestamp corresponding to the time that file/directory 'sym was last modified.", + "kind": "symbol", + "name": "mtime", + "signature": "'sym ==> float" + }, + "mv": { + "description": "Moves the file or directory 'sym1 to 'sym2.", + "kind": "symbol", + "name": "mv", + "signature": "'sym1 'sym2 ==> " + }, + "nan": { + "description": "Returns **NaN** (not a number).", + "kind": "symbol", + "name": "nan", + "signature": " ==> nan" + }, + "newline": { + "description": "Prints a new line to STDOUT.", + "kind": "symbol", + "name": "newline", + "signature": " ==> " + }, + "nip": { + "description": "Removes the second element from the stack.", + "kind": "symbol", + "name": "nip", + "signature": "a1 a2 ==> a2" + }, + "not": { + "description": "Negates bool1.", + "kind": "symbol", + "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", + "name": "notice", + "signature": "a ==> a" + }, + "notice!": { + "description": "Prints a (removing it from the stack) and a new line to STDOUT, if logging level is set to [notice](class:kwd) (default) or lower.", + "kind": "symbol", + "name": "notice!", + "signature": "a ==> " + }, + "now": { + "description": "Returns the current time as Unix timestamp with microseconds.", + "kind": "symbol", + "name": "now", + "signature": " ==> float" + }, + "null?": { + "description": "Returns true if a is null, false otherwise.", + "kind": "symbol", + "name": "null?", + "signature": "a ==> bool" + }, + "number?": { + "description": "Returns true if a is a number, false otherwise.", + "kind": "symbol", + "name": "number?", + "signature": "a ==> bool" + }, + "odd?": { + "description": "Returns true if int is odd, false otherwise.", + "kind": "symbol", + "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", + "name": "one?", + "signature": "quot1 quot2 ==> bool" }, "operator": { "description": "Provides a way to define a new operator (symbol or sigil) 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 or sigil).\n * A symbol identifying the name of the operator.\n * A quotation defining the signature of the operatorm containing input and output values identified by their type and a capturing symbol, separated by the == symbol.\n * A quotation identifying the body of the operator.\n\n The main additional features offered by this way of defining operators are the following:\n\n * Both input and output values are checked against a type (like when using the expect operator *and* automatically captured in a symbol that can be referenced in the operator body quotation.\n * The full signature of the operator is declared, making the resulting code easier to understand at quick glance.\n * An exception is automatically raised if the operator body pollutes the stack by adding or removing elementa from the stack (besides adding the declared output values).\n * It is possible to use the return symbol within the body quotation to immediately stop the evaluation of the body quotation and automatically push the output values on the stack.\n \n \n Example\n \n The following program defines a pow operator that calculates the power of a number providing its base and exponent, and handling some NaN results using the return symbol:\n\n (\n symbol pow\n (num :base int :exp == num :result)\n ( \n (base 0 == exp 0 == and)\n (nan @result return)\n when\n (base 1 == exp inf == and)\n (nan @result return)\n when\n (base inf == exp 0 == and)\n (nan @result return)\n when\n exp 1 - :n\n base (dup) n times (*) n times @result\n )\n ) ::", - "input": "quot", + "kind": "symbol", "name": "operator", - "output": "a*" + "signature": "quot ==> a*" }, "opts": { "description": "Returns a dictionary of all options passed to the current program, with their respective values.", - "input": "", + "kind": "symbol", "name": "opts", - "output": "dict" + "signature": " ==> dict" + }, + "or": { + "description": "Returns true if bool1 or bool2 is true, false otherwise.", + "kind": "symbol", + "name": "or", + "signature": "bool1 bool2 ==> bool3" + }, + "ord": { + "description": "Returns the ASCII code int corresponding to the single character string.", + "kind": "symbol", + "name": "ord", + "signature": "string ==> 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", + "name": "os", + "signature": " ==> string" + }, + "over": { + "description": "Pushes a copy of the second element on top of the stack.", + "kind": "symbol", + "name": "over", + "signature": "a1 a2 ==> a1 a2 a1" }, "parse": { "description": "Parses string and returns a quoted program quot.", - "input": "string", + "kind": "symbol", "name": "parse", - "output": "quot" + "signature": "string ==> quot" + }, + "parse-url": { + "description": "Parses the url string into its components and stores them into url.", + "kind": "symbol", + "name": "parse-url", + "signature": "string ==> url" + }, + "partition": { + "description": "Partitions quot1 into two quotations: quot3 contains all elements of quot1 that satisfy predicate quot2, quot4 all the others.\n \n \n Example\n \n The following program leaves (1 3 5) (2 4 6) on the stack:\n \n (1 2 3 4 5 6) \n (odd?) partition", + "kind": "symbol", + "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", + "name": "password", + "signature": " ==> string" + }, + "pi": { + "description": "Returns the value of the &pi; constant.", + "kind": "symbol", + "name": "pi", + "signature": " ==> num" + }, + "pick": { + "description": "Pushes a copy of the third element on top of the stack.", + "kind": "symbol", + "name": "pick", + "signature": "a1 a2 a3 ==> a1 a2 a3 a1" + }, + "pop": { + "description": "Removes the first element from the stack.", + "kind": "symbol", + "name": "pop", + "signature": "a ==> " + }, + "pow": { + "description": "Computes num1 to power raised of num2.", + "kind": "symbol", + "name": "pow", + "signature": "num1 num2 ==> num3" + }, + "pred": { + "description": "Returns the predecessor of int1.", + "kind": "symbol", + "name": "pred", + "signature": "int1 ==> int2" + }, + "prefix": { + "description": "Prepends 'sym2 to 'sym1.", + "kind": "symbol", + "name": "prefix", + "signature": "'sym1 'sym2 ==> string" }, "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", - "input": "quot", + "kind": "symbol", "name": "prefix-dequote", - "output": "a" + "signature": "quot ==> a" + }, + "prepend": { + "description": "Returns a new quotation containing the contents of quot with a prepended.", + "kind": "symbol", + "name": "prepend", + "signature": "a quot ==> (a a*)" + }, + "print": { + "description": "Prints a to STDOUT.", + "kind": "symbol", + "name": "print", + "signature": "a ==> a" + }, + "print!": { + "description": "Prints a to STDOUT and removes a from the stack.", + "kind": "symbol", + "name": "print!", + "signature": "a ==> " + }, + "product": { + "description": "Returns the product of all items of quot. quot is a quotation of integers.", + "kind": "symbol", + "name": "product", + "signature": "quot ==> int" }, "prompt": { "description": "This symbol is used to configure the prompt of the min shell. By default, it is set to the following quotation:\n \n (\"[$1]$$ \" (.) = %)\n \n Unlike other predefined symbols, this symbol is _unsealed_, which means it can be modified.", - "input": "", + "kind": "symbol", "name": "prompt", - "output": "string" + "signature": " ==> string" }, "publish": { "description": "Publishes symbol 'sym to the scope of dict.\n \n \n Example\n \n Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope:\n 'my-local-symbol ROOT publish", - "input": "'sym dict", + "kind": "symbol", "name": "publish", - "output": "" + "signature": "'sym dict ==> " + }, + "put-env": { + "description": "Sets environment variable 'sym2 to 'sym1.", + "kind": "symbol", + "name": "put-env", + "signature": "'sym1 'sym2 ==> string" + }, + "putchr": { + "description": "Prints string to STDOUT without printing a new line (string must contain only one character).", + "kind": "symbol", + "name": "putchr", + "signature": "string ==> a" }, "puts": { "description": "Prints a and a new line to STDOUT.", - "input": "a", + "kind": "symbol", "name": "puts", - "output": "a" + "signature": "a ==> a" }, "puts!": { "description": "Prints a and a new line to STDOUT, removing a from the stack.", - "input": "a", + "kind": "symbol", "name": "puts!", - "output": "" + "signature": "a ==> " }, "quit": { "description": "Exits the program or shell with 0 as return code.", - "input": "", + "kind": "symbol", "name": "quit", - "output": "" + "signature": " ==> " + }, + "quotation?": { + "description": "Returns true if a is a quotation, false otherwise.", + "kind": "symbol", + "name": "quotation?", + "signature": "a ==> bool" }, "quote": { "description": "Wraps a in a quotation.", - "input": "a", + "kind": "symbol", "name": "quote", - "output": "(a)" + "signature": "a ==> (a)" }, "quote-bind": { "description": "Quotes a and binds the quotation to the existing symbol 'sym.", - "input": "a 'sym", + "kind": "symbol", "name": "quote-bind", - "output": "" + "signature": "a 'sym ==> " }, "quote-define": { "description": "Quotes a and assigns the quotation to the symbol 'sym, creating it if not already defined.", - "input": "a 'sym", + "kind": "symbol", "name": "quote-define", - "output": "" + "signature": "a 'sym ==> " + }, + "quote-map": { + "description": "Returns a new quotation quot2 obtained by quoting each element of quot1.", + "kind": "symbol", + "name": "quote-map", + "signature": "quot1 ==> quot2" + }, + "r2d": { + "description": "Converts num1 from radians to degrees.", + "kind": "symbol", + "name": "r2d", + "signature": "num1 ==> num2" }, "raise": { "description": "Raises the error specified via the dictionary dict:error.", - "input": "dict:error", + "kind": "symbol", "name": "raise", - "output": "" + "signature": "dict:error ==> " + }, + "random": { + "description": "Returns a random number int2 between 0 and int1-1. \n \n \n Note\n \n You must call randomize to initialize the random number generator, otherwise the same sequence of numbers will be returned.", + "kind": "symbol", + "name": "random", + "signature": "int1 ==> int2" + }, + "randomize": { + "description": "Initializes the random number generator using a seed based on the current timestamp.", + "kind": "symbol", + "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", + "name": "range", + "signature": "quot2 ==> quot2" }, "raw-args": { "description": "Returns a list of all arguments and (non-parsed) options passed to the current program.", - "input": "", + "kind": "symbol", "name": "raw-args", - "output": "quot" + "signature": " ==> quot" + }, + "recv": { + "description": "Waits to receive int characters from dict:socket and returns the resulting data string.", + "kind": "symbol", + "name": "recv", + "signature": "dict:socket int ==> string" + }, + "recv-line": { + "description": "Waits to receive a line of data from dict:socket and returns the resulting data string. \"\" 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", + "name": "recv-line", + "signature": "dict:socket ==> string" + }, + "reduce": { + "description": "Combines each successive element of quot1 using quot2. On the first iteration, the first two inputs processed by quot2 are a and the first element of quot1.\n \n \n Example\n \n The following program leaves 120 on the stack:\n \n (1 2 3 4 5) \n 1 (*) reduce", + "kind": "symbol", + "name": "reduce", + "signature": "quot1 a quot2 ==> int" + }, + "regex": { + "description": "Performs a search and/or a search-and-replace operation using pattern string2.\n \n string2 can be one of the following patterns:\n \n * **/**_search-regex_**/**_modifiers_\n * **s/**_search-regex_**/**_replacemenet_**/**_modifiers_\n \n quot is always a quotation containing:\n \n * One or more strings containing the first match and captures (if any), like for the search operator.\n * A string containing the resuling string after the search-and-replace operation.\n \n \n Tip\n \n * _search-regex_ can be a sgregex-compatible regular expression.\n * _modifiers_ are optionals can contain one or more of the following characters, in any order:\n * **i**: case-insensitive match.\n * **m**: multi-line match.\n * **s**: dot character includes newlines.\n \n \n Example: Search\n \n The following:\n \n \"This is a GOOD idea.\" \"/(good) idea/i\" regex\n \n produces: (\"GOOD idea\", \"GOOD\")\n \n \n Example: Search and Replace\n \n The following:\n \n \"This is a GOOD idea.\" \"s/good/bad/i\" regex\n \n produces: (\"This is a bad idea\")", + "kind": "symbol", + "name": "regex", + "signature": "string1 string2 ==> quot" + }, + "reject": { + "description": "Returns a new quotatios quot3 including all elements of quot1 that do not satisfy predicate quot2 (i.e. the opposite of filter)", + "kind": "symbol", + "name": "reject", + "signature": "quot1 quot2 ==> quot3" + }, + "remove": { + "description": "Returns the _n^th_ element of quot1 (zero-based), and returns the modified copy of the quotation quot2.", + "kind": "symbol", + "name": "remove", + "signature": "quot1 int ==> quot2" }, "remove-symbol": { "description": "Removes the symbol 'sym from the [.min\\_symbols](class:file) file.", - "input": "'sym", + "kind": "symbol", "name": "remove-symbol", - "output": "" + "signature": "'sym ==> " + }, + "repeat": { + "description": "Returns string containing 'sym repeated int times.", + "kind": "symbol", + "name": "repeat", + "signature": "'sym int ==> string" + }, + "replace": { + "description": "Returns a copy of string1 containing all occurrences of string2 replaced by string3\n \n Tip\n \n string2 can be a sgregex-compatible regular expression.\n \n \n Example\n \n The following:\n \n \"This is a stupid test. Is it really a stupid test?\" \" s[a-z]+\" \" simple\" replace\n \n produces:\n \n \"This is a simple test. Is it really a simple test?\"", + "kind": "symbol", + "name": "replace", + "signature": "string1 string2 string3 ==> string4" + }, + "request": { + "description": "Performs an HTTP request.\n \n \n Example\n \n The following code constructs a request dictionary 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", + "name": "request", + "signature": "request ==> response" }, "require": { "description": "Parses and interprets (in a separater interpreter) the specified min file 'sym, adding [.min](class:ext) if not specified, and returns a module dictionary dict containing all the symbols defined in 'sym.", - "input": "'sym", + "kind": "symbol", "name": "require", - "output": "dict" + "signature": "'sym ==> dict" + }, + "rest": { + "description": "Returns a new quotation quot2 containing all elements of quot1 quotation except for the first.", + "kind": "symbol", + "name": "rest", + "signature": "quot1 ==> quot2" }, "return": { "description": "If used within the body quotation of an operator definition, causes the interpreter to stop pushing further body elements on the stack and start pushing tbe operator output values on the stack. \n\nIf used outside of the body quotation of an operator definition, it raises an exception.", - "input": "", + "kind": "symbol", "name": "return", - "output": "" + "signature": " ==> " + }, + "reverse": { + "description": "Returns a new quotation quot2 containing all elements of quot1 in reverse order.", + "kind": "symbol", + "name": "reverse", + "signature": "quot1 ==> quot2" + }, + "rm": { + "description": "Deletes the specified file 'sym.", + "kind": "symbol", + "name": "rm", + "signature": "'sym ==> " + }, + "rmdir": { + "description": "Deletes the specified directory 'sym and all its subdirectories recursively.", + "kind": "symbol", + "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", + "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", + "name": "rollup", + "signature": "a1 a2 a3 ==> a3 a2 a1" + }, + "round": { + "description": "Rounds num1 to the int^th decimal place.", + "kind": "symbol", + "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", + "name": "run", + "signature": "'sym ==> dict" }, "save-symbol": { "description": "Saves the contents of symbol 'sym to the [.min\\_symbols](class:file) file.", - "input": "'sym", + "kind": "symbol", "name": "save-symbol", - "output": "" + "signature": "'sym ==> " }, "saved-symbols": { "description": "Returns a quotation containing all symbols saved in the [.min\\_symbols](class:file) file.", - "input": "", + "kind": "symbol", "name": "saved-symbols", - "output": "(string*)" + "signature": " ==> (string*)" }, "scope": { "description": "Returns a dictionary dict holding a reference to the current scope.\n \n This can be useful to save a reference to a given execution scope to access later on.\n\n \n Example\n \n The following program leaves {(2) :two ;module} on the stack:\n \n {} :myscope (2 :two scope @myscope) -", - "input": "", + "kind": "symbol", "name": "scope", - "output": "dict" + "signature": " ==> dict" }, "scope-sigils": { "description": "Returns a list of all sigils defined in dictionary dict.", - "input": "dict", + "kind": "symbol", "name": "scope-sigils", - "output": "(string*)" + "signature": "dict ==> (string*)" }, "scope-symbols": { "description": "Returns a list of all symbols defined in dictionary dict.", - "input": "dict", + "kind": "symbol", "name": "scope-symbols", - "output": "(string*)" + "signature": "dict ==> (string*)" }, "seal": { "description": "Seals symbol 'sym, so that it cannot be re-assigned.", - "input": "'sym", + "kind": "symbol", "name": "seal", - "output": "" + "signature": "'sym ==> " }, "seal-sigil": { "description": "Seals the user-defined sigil 'sym, so that it cannot be re-defined.", - "input": "'sym", + "kind": "symbol", "name": "seal-sigil", - "output": "" + "signature": "'sym ==> " }, "sealed-sigil?": { "description": "Returns true if the sigil 'sym is sealed, false otherwise.", - "input": "'sym", + "kind": "symbol", "name": "sealed-sigil?", - "output": "bool" + "signature": "'sym ==> bool" }, "sealed?": { "description": "Returns true if the symbol 'sym is sealed, false otherwise.", - "input": "'sym", + "kind": "symbol", "name": "sealed?", - "output": "bool" - }, - "set-type": { - "description": "Sets the type for dictionary dict to 'sym.", - "input": "dict 'sym", - "name": "set-type", - "output": "dict" - }, - "sigils": { - "description": "Returns a list of all sigils defined in the [ROOT](class:kwd) scope.", - "input": "", - "name": "sigils", - "output": "(string*)" - }, - "source": { - "description": "Display the source code of symbol 'sym (if it has been implemented a min quotation).", - "input": "'sym", - "name": "source", - "output": "quot" - }, - "string": { - "description": "Converts a to its string representation.", - "input": "a", - "name": "string", - "output": "string" - }, - "symbols": { - "description": "Returns a list of all symbols defined in the [ROOT](class:kwd) scope.", - "input": "", - "name": "symbols", - "output": "(string*)" - }, - "tap": { - "description": "Performs the following operations:\n \n 1. Removes a from the stack.\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\n 1. Pushes a back to the stack.\n 2. Dequotes the quotation and saves the result as a.\n 3. Push the resulting a back on the stack.\n \n \n Example\n \n The following program:\n \n {1 :a 2 :b 3 :c} (\n (dup /a succ succ b)\n ) tap\n \n Returns {3 :a 3 :b 3 :c}.", - "input": "a quot", - "name": "tap", - "output": "a" - }, - "tap!": { - "description": "Performs the following operations:\n \n 1. Removes a from the stack.\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\n 1. Pushes a back to the stack.\n 2. Dequotes the quotation and saves the result as a.\n \n \n Example\n \n The following program:\n \n \"\" :s1\n \"test\" (\n (' \"1\" swap append \"\" join)\n (' \"2\" swap append \"\" join)\n (' \"3\" swap append \"\" join @s1 s1)\n ) tap!\n \n Sets s1 to \"test123\".", - "input": "a quot", - "name": "tap!", - "output": "a" - }, - "times": { - "description": "Applies the quotation quot int times.", - "input": "quot int", - "name": "times", - "output": "a*" - }, - "to-json": { - "description": "Converts a into a JSON string.", - "input": "a", - "name": "to-json", - "output": "string" - }, - "to-yaml": { - "description": "Converts a into a YAML string.\n\n \n Note\n \n At present, only min dictionaries containing string values are supported.", - "input": "a", - "name": "to-yaml", - "output": "string" - }, - "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", - "input": "(quot1 quot2? quot3?)", - "name": "try", - "output": "a*" - }, - "typeclass": { - "description": "Defines a new type class 'sym set to quotation quot, which can be used in operator signatures.\n \n \n Example\n \n Consider the following type class which defines a natural number: \n\n (:n ((n integer?) (n 0 )) &&) 'natural typeclass\n \n It can now be used in operator signatures, like this:\n \n (\n symbol natural-sum\n (natural :n natural :m == natural :result)\n (n m + @result)\n ) ::", - "input": "quot 'sym", - "name": "typeclass", - "output": "" - }, - "unless": { - "description": "If 1 evaluates to false then evaluates 2.", - "input": "quot1 quot2", - "name": "unless", - "output": "a*" - }, - "unseal": { - "description": "Unseals the user-defined symbol 'sym, so that it can be re-assigned.", - "input": "'sym", - "name": "unseal", - "output": "" - }, - "unseal-sigil": { - "description": "Unseals sigil 'sym, so that it can be re-defined (system sigils cannot be unsealed).", - "input": "'sym", - "name": "unseal-sigil", - "output": "" - }, - "version": { - "description": "Returns the current min version number.", - "input": "", - "name": "version", - "output": "string" - }, - "when": { - "description": "If quot1 evaluates to true then evaluates quot2.", - "input": "quot1 quot2", - "name": "when", - "output": "a*" - }, - "while": { - "description": "Executes quot2 while quot1 evaluates to true.\n \n \n Example\n \n The following program prints all natural numbers from 0 to 10:\n \n 0 :count \n (count 10 <=) \n (count puts succ @count) while", - "input": "quot1 quot2", - "name": "while", - "output": "a*" - }, - "with": { - "description": "Pushes each item of quot1 on the stack using the scope of quot2 as scope. \n\n \n Example\n \n This operator is useful to define symbols on the [ROOT](class:kwd) scope or another scope. For example min's prelude includes the following code used to import certain modules only if min was not compiled in lite mode:\n \n 'lite? (\n (\n 'crypto import\n 'math import\n 'net import\n 'http import\n ) ROOT with\n ) unless", - "input": "quot1 quot2", - "name": "with", - "output": "a*" - } - }, - "logic": { - "!=": { - "description": "Returns true if a1 is not equal to a2, false otherwise.", - "input": "a1 a2", - "name": "!=", - "output": "bool" - }, - "&gt;": { - "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.", - "input": "a1 a2", - "name": "&gt;", - "output": "bool" - }, - "&gt;=": { - "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.", - "input": "a1 a2", - "name": "&gt;=", - "output": "bool" + "signature": "'sym ==> bool" }, - "&lt;": { - "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.", - "input": "a1 a2", - "name": "&lt;", - "output": "bool" + "search": { + "description": "Returns a quotation of quotations (like the one returned by the search operator) containing all occurrences of string2 within string1.", + "kind": "symbol", + "name": "search", + "signature": "string1 string2 ==> quot" }, - "&lt;=": { - "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.", - "input": "a1 a2", - "name": "&lt;=", - "output": "bool" + "semver-inc-major": { + "description": "Increments the major digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", + "kind": "symbol", + "name": "semver-inc-major", + "signature": "string1 ==> string2" }, - "==": { - "description": "Returns true if a1 is equal to a2, false otherwise.", - "input": "a1 a2", - "name": "==", - "output": "bool" + "semver-inc-minor": { + "description": "Increments the minor digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", + "kind": "symbol", + "name": "semver-inc-minor", + "signature": "string1 ==> string2" }, - "and": { - "description": "Returns true if bool1 is equal to bool2, false otherwise.", - "input": "bool1 bool2", - "name": "and", - "output": "bool3" - }, - "boolean?": { - "description": "Returns true if a is a boolean, false otherwise.", - "input": "a", - "name": "boolean?", - "output": "bool" + "semver-inc-patch": { + "description": "Increments the patch digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", + "kind": "symbol", + "name": "semver-inc-patch", + "signature": "string1 ==> string2" }, - "dictionary?": { - "description": "Returns true if a is a dictionary, false otherwise.", - "input": "a", - "name": "dictionary?", - "output": "bool" - }, - "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.", - "input": "quot", - "name": "expect-all", - "output": "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.", - "input": "quot", - "name": "expect-any", - "output": "bool" - }, - "float?": { - "description": "Returns true if a is a float, false otherwise.", - "input": "a", - "name": "float?", - "output": "bool" - }, - "integer?": { - "description": "Returns true if a is an integer, false otherwise.", - "input": "a", - "name": "integer?", - "output": "bool" - }, - "not": { - "description": "Negates bool1.", - "input": "bool1", - "name": "not", - "output": "bool2" - }, - "null?": { - "description": "Returns true if a is null, false otherwise.", - "input": "a", - "name": "null?", - "output": "bool" - }, - "number?": { - "description": "Returns true if a is a number, false otherwise.", - "input": "a", - "name": "number?", - "output": "bool" - }, - "or": { - "description": "Returns true if bool1 or bool2 is true, false otherwise.", - "input": "bool1 bool2", - "name": "or", - "output": "bool3" - }, - "quotation?": { - "description": "Returns true if a is a quotation, false otherwise.", - "input": "a", - "name": "quotation?", - "output": "bool" - }, - "string?": { - "description": "Returns true if a is a string, false otherwise.", - "input": "a", - "name": "string?", - "output": "bool" - }, - "stringlike?": { - "description": "Returns true if a is a string or a quoted symbol, false otherwise.", - "input": "a", - "name": "stringlike?", - "output": "bool" - }, - "type?": { - "description": "Returns true if the data type of a is the specified type 'sym, false otherwise.", - "input": "a 'sym", - "name": "type?", - "output": "bool" - }, - "xor": { - "description": "Returns true if bool1 and bool2 are different, false otherwise.", - "input": "bool1 bool2", - "name": "xor", - "output": "bool3" - } - }, - "math": { - "abs": { - "description": "Calculates tbe absolute value of num1.", - "input": "num1", - "name": "abs", - "output": "num2" - }, - "acos": { - "description": "Calculates the arc cosine of num1 (in radians).", - "input": "num1", - "name": "acos", - "output": "num2" - }, - "asin": { - "description": "Calculates the arc sine of num1 (in radians).", - "input": "num1", - "name": "asin", - "output": "num2" - }, - "atan": { - "description": "Calculates the arc tangent of num1 (in radians).", - "input": "num1", - "name": "atan", - "output": "num2" - }, - "ceil": { - "description": "Returns the smallest integer int that is not smaller than num.", - "input": "num", - "name": "ceil", - "output": "int" - }, - "cos": { - "description": "Calculates the cosine of num1 (in radians).", - "input": "num1", - "name": "cos", - "output": "num2" - }, - "cosh": { - "description": "Calculates the hyperbolic cosine of num1 (in radians).", - "input": "num1", - "name": "cosh", - "output": "num2" - }, - "d2r": { - "description": "Converts num1 from degrees to radians.", - "input": "num1", - "name": "d2r", - "output": "num2" - }, - "e": { - "description": "Returns the value of the _e_ constant (Euler's number).", - "input": "", - "name": "e", - "output": "num" - }, - "floor": { - "description": "Returns the largest integer int that is not greater than num.", - "input": "num", - "name": "floor", - "output": "int" - }, - "ln": { - "description": "Calculates the natural logarithm of num1.", - "input": "num1", - "name": "ln", - "output": "num2" - }, - "log10": { - "description": "Calculates the common logarithm of num1.", - "input": "num1", - "name": "log10", - "output": "num2" - }, - "log2": { - "description": "Calculates the binary logarithm of num1.", - "input": "num1", - "name": "log2", - "output": "num2" - }, - "pi": { - "description": "Returns the value of the &pi; constant.", - "input": "", - "name": "pi", - "output": "num" - }, - "pow": { - "description": "Computes num1 to power raised of num2.", - "input": "num1 num2", - "name": "pow", - "output": "num3" - }, - "r2d": { - "description": "Converts num1 from radians to degrees.", - "input": "num1", - "name": "r2d", - "output": "num2" - }, - "round": { - "description": "Rounds num1 to the int^th decimal place.", - "input": "num1 int", - "name": "round", - "output": "num2" - }, - "sin": { - "description": "Calculates the sine of num1 (in radians).", - "input": "num1", - "name": "sin", - "output": "num2" - }, - "sinh": { - "description": "Calculates the hyperbolic sine of num1 (in radians).", - "input": "num1", - "name": "sinh", - "output": "num2" - }, - "sqrt": { - "description": "Returns square root of num1.", - "input": "num1", - "name": "sqrt", - "output": "num2" - }, - "tan": { - "description": "Calculates the tangent of num1 (in radians).", - "input": "num1", - "name": "tan", - "output": "num2" - }, - "tanh": { - "description": "Calculates the hyperbolic tangent of num1 (in radians).", - "input": "num1", - "name": "tanh", - "output": "num2" - }, - "tau": { - "description": "Returns the value of the &tau; constant (2&pi;).", - "input": "", - "name": "tau", - "output": "num" - }, - "trunc": { - "description": "Truncates num to the decimal point.", - "input": "num1", - "name": "trunc", - "output": "num2" - } - }, - "net": { - "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.", - "input": "dict:socket1 dict:socket2", - "name": "accept", - "output": "dict:socket1" - }, - "close": { - "description": "Closes a previously-opened socket.", - "input": "dict:socket", - "name": "close", - "output": "" - }, - "connect": { - "description": "Connects socket dict:socket to address string 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", - "input": "dict:socket string int", - "name": "connect", - "output": "dict:socket" - }, - "recv": { - "description": "Waits to receive int characters from dict:socket and returns the resulting data string.", - "input": "dict:socket int", - "name": "recv", - "output": "string" - }, - "recv-line": { - "description": "Waits to receive a line of data from dict:socket and returns the resulting data string. \"\" 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", - "input": "dict:socket", - "name": "recv-line", - "output": "string" + "semver?": { + "description": "Checks whether string is a [SemVer](https://semver.org)-compliant version or not.", + "kind": "symbol", + "name": "semver?", + "signature": "string ==> bool" }, "send": { "description": "Sends string to the connected socket dict:socket.", - "input": "dict:socket string", + "kind": "symbol", "name": "send", - "output": "" + "signature": "dict:socket string ==> " }, - "socket": { - "description": "Opens a new socket.\n \n dict can be empty or contain any of the following properties, used to specify the domain, type and protocol of the socket respectively.\n \n domain\n : The socket domain. It can be set to one of the following values:\n \n * **ipv4** (default): Internet Protocol version 4.\n * **ipv6**: Internet Protocol version 6.\n * **unix**: local Unix file (not supported on Windows systems).\n type\n : The socket type. It can be set to one of the following values:\n \n * **stream** (default): Reliable stream-oriented service or Stream Socket.\n * **dgram**: Datagram service or Datagram Socket.\n * **raw**: Raw protocols atop the network layer.\n * **seqpacket**: Reliable sequenced packet service.\n protocol\n : The socket protocol. It can be set to one of the following values:\n \n * **tcp** (default): Transmission Control Protocol.\n * **udp**: User Datagram Protocol.\n * **ipv4**: Internet Protocol version 4 (not supported on Windows systems).\n * **ipv6**: Internet Protocol version 6 (not supported on Windows systems).\n * **raw**: Raw IP Packets protocol (not supported on Windows systems).\n * **icmp**: Internet Control Message Protocol (not supported on Windows systems).", - "input": "dict", - "name": "socket", - "output": "dict:socket" - } - }, - "num": { - "+": { - "description": "Sums num1 and num2.", - "input": "num1 num2", - "name": "+", - "output": "num3" + "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", + "name": "set", + "signature": "quot1 a int ==> quot2" }, - "-": { - "description": "Subtracts num2 from num1.", - "input": "num1 num2", - "name": "-", - "output": "num3" + "set-stack": { + "description": "Substitute the existing stack with the contents of quot.", + "kind": "symbol", + "name": "set-stack", + "signature": "quot ==> a*" }, - "-inf": { - "description": "Returns negative infinity.", - "input": "", - "name": "-inf", - "output": "num" + "set-type": { + "description": "Sets the type for dictionary dict to 'sym.", + "kind": "symbol", + "name": "set-type", + "signature": "dict 'sym ==> dict" }, - "/": { - "description": "Divides num1 by num2.", - "input": "num1 num2", - "name": "/", - "output": "num3" + "sha1": { + "description": "Returns the SHA1 hash of 'sym.", + "kind": "symbol", + "name": "sha1", + "signature": "'sym ==> string" }, - "\\*": { - "description": "Multiplies num1 by num2.", - "input": "num1 num2", - "name": "\\*", - "output": "num3" + "sha224": { + "description": "Returns the SHA224 hash of 'sym.", + "kind": "symbol", + "name": "sha224", + "signature": "'sym ==> string" }, - "avg": { - "description": "Returns the average of the items of quot.", - "input": "quot", - "name": "avg", - "output": "num" + "sha256": { + "description": "Returns the SHA256 hash of 'sym.", + "kind": "symbol", + "name": "sha256", + "signature": "'sym ==> string" }, - "bitand": { - "description": "Computes the bitwise *and* of numbers int1 and int2.", - "input": "int1 int2", - "name": "bitand", - "output": "int3" + "sha384": { + "description": "Returns the SHA384 hash of 'sym.", + "kind": "symbol", + "name": "sha384", + "signature": "'sym ==> string" }, - "bitnot": { - "description": "Computes the bitwise *complement* of int1.", - "input": "int1", - "name": "bitnot", - "output": "int2" - }, - "bitor": { - "description": "Computes the bitwise *or* of numbers int1 and int2.", - "input": "int1 int2", - "name": "bitor", - "output": "int3" - }, - "bitxor": { - "description": "Computes the bitwise *xor* of numbers int1 and int2.", - "input": "int1 int2", - "name": "bitxor", - "output": "int3" - }, - "div": { - "description": "Divides int1 by int2 (integer division).", - "input": "int1 int2", - "name": "div", - "output": "int3" - }, - "even?": { - "description": "Returns true if int is even, false otherwise.", - "input": "int", - "name": "even?", - "output": "bool" - }, - "inf": { - "description": "Returns infinity.", - "input": "", - "name": "inf", - "output": "num" - }, - "med": { - "description": "Returns the median of the items of quot.", - "input": "quot", - "name": "med", - "output": "num" - }, - "mod": { - "description": "Returns the integer module of int1 divided by int2.", - "input": "int1 int2", - "name": "mod", - "output": "int3" - }, - "nan": { - "description": "Returns **NaN** (not a number).", - "input": "", - "name": "nan", - "output": "nan" - }, - "odd?": { - "description": "Returns true if int is odd, false otherwise.", - "input": "int", - "name": "odd?", - "output": "bool" - }, - "pred": { - "description": "Returns the predecessor of int1.", - "input": "int1", - "name": "pred", - "output": "int2" - }, - "product": { - "description": "Returns the product of all items of quot. quot is a quotation of integers.", - "input": "quot", - "name": "product", - "output": "int" - }, - "random": { - "description": "Returns a random number int2 between 0 and int1-1. \n \n \n Note\n \n You must call randomize to initialize the random number generator, otherwise the same sequence of numbers will be returned.", - "input": "int1", - "name": "random", - "output": "int2" - }, - "randomize": { - "description": "Initializes the random number generator using a seed based on the current timestamp.", - "input": "", - "name": "randomize", - "output": "{{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.", - "input": "quot2", - "name": "range", - "output": "quot2" + "sha512": { + "description": "Returns the SHA512 hash of 'sym.", + "kind": "symbol", + "name": "sha512", + "signature": "'sym ==> string" }, "shl": { "description": "Computes the *shift left* operation of int1 and int2.", - "input": "int1 int2", + "kind": "symbol", "name": "shl", - "output": "int3" + "signature": "int1 int2 ==> int3" + }, + "shorten": { + "description": "Returns a quotation quot2 containing the first _n_ values of the input quotation quot1.", + "kind": "symbol", + "name": "shorten", + "signature": "quot1 int ==> quot2" }, "shr": { "description": "Computes the *shift right* operation of int1 and int2.", - "input": "int1 int2", + "kind": "symbol", "name": "shr", - "output": "int3" - }, - "succ": { - "description": "Returns the successor of int1.", - "input": "int1", - "name": "succ", - "output": "int2" - }, - "sum": { - "description": "Returns the sum of all items of quot. quot is a quotation of integers.", - "input": "quot", - "name": "sum", - "output": "int" - } - }, - "seq": { - "all?": { - "description": "Applies predicate quot2 to each element of quot1 and returns true if all elements of quot1 satisfy predicate quot2, false otherwise.", - "input": "quot1 quot2", - "name": "all?", - "output": "bool" - }, - "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.", - "input": "quot1 quot2", - "name": "any?", - "output": "bool" - }, - "append": { - "description": "Returns a new quotation containing the contents of quot with a appended.", - "input": "a quot", - "name": "append", - "output": "(a* a)" - }, - "concat": { - "description": "Concatenates quot1 with quot2.", - "input": "quot1 quot2", - "name": "concat", - "output": "quot3" - }, - "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", - "input": "quot1 quot2", - "name": "difference", - "output": "quot3" - }, - "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.", - "input": "quot1 int", - "name": "drop", - "output": "quot2" - }, - "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", - "input": "quot1 quot2", - "name": "filter", - "output": "quot3" - }, - "find": { - "description": "Returns the index of the first element within quot1 that satisfies predicate quot2, or -1 if no element satisfies it.\n \n \n Example\n \n The following program leaves 3 on the stack:\n \n (1 2 4 8 16) \n (5 ) find", - "input": "quot1 quot2", - "name": "find", - "output": "int" - }, - "first": { - "description": "Returns the first element of quot.", - "input": "quot", - "name": "first", - "output": "a" - }, - "flatten": { - "description": "Flattens all quotations within quot1 and returns the resulting sequence quot2.\n \n \n Example\n \n The following program leaves (1 2 3 4 5 6 7 8) on the stack:\n \n (1 (2 3 4) 5 (6 7) 8) \n flatten", - "input": "quot1", - "name": "flatten", - "output": "quot2" - }, - "get": { - "description": "Returns the _n^th_ element of quot (zero-based).", - "input": "quot int", - "name": "get", - "output": "a" - }, - "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", - "input": "quot1", - "name": "harvest", - "output": "quot2" - }, - "in?": { - "description": "Returns true if a is contained in quot, false otherwise.", - "input": "quot a", - "name": "in?", - "output": "bool" - }, - "insert": { - "description": "Inserts a as the value of the _n^th_ element quot1 (zero-based), and returns the modified copy of the quotation quot2.", - "input": "quot1 a int", - "name": "insert", - "output": "quot2" - }, - "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", - "input": "quot1 quot2", - "name": "intersection", - "output": "quot3" - }, - "last": { - "description": "Returns the last element of quot.", - "input": "quot", - "name": "last", - "output": "a" - }, - "map": { - "description": "Returns a new quotation quot3 obtained by applying quot2 to each element of quot1.", - "input": "quot1 quot2", - "name": "map", - "output": "quot3" - }, - "map-reduce": { - "description": "Applies quot2 (map) to each element of quot1 and then applies quot3 (reduce) to each successive element of quot1. quot1 must have at least one element.\n \n \n Example\n \n The following program leaves 35 on the stack:\n \n (1 3 5) \n (dup *) (+) map-reduce", - "input": "quot1 quot2 quot3", - "name": "map-reduce", - "output": "int" + "signature": "int1 int2 ==> int3" }, - "one?": { - "description": "Applies predicate quot2 to each element of quot1 and returns true if only one element of quot1 satisfies predicate quot2, false otherwise.", - "input": "quot1 quot2", - "name": "one?", - "output": "bool" + "sigils": { + "description": "Returns a list of all sigils defined in the [ROOT](class:kwd) scope.", + "kind": "symbol", + "name": "sigils", + "signature": " ==> (string*)" }, - "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", - "input": "quot1 quot2", - "name": "partition", - "output": "quot3 quot4" - }, - "prepend": { - "description": "Returns a new quotation containing the contents of quot with a prepended.", - "input": "a quot", - "name": "prepend", - "output": "(a a*)" - }, - "quote-map": { - "description": "Returns a new quotation quot2 obtained by quoting each element of quot1.", - "input": "quot1", - "name": "quote-map", - "output": "quot2" - }, - "reduce": { - "description": "Combines each successive element of quot1 using quot2. On the first iteration, the first two inputs processed by quot2 are a and the first element of quot1.\n \n \n Example\n \n The following program leaves 120 on the stack:\n \n (1 2 3 4 5) \n 1 (*) reduce", - "input": "quot1 a quot2", - "name": "reduce", - "output": "int" - }, - "reject": { - "description": "Returns a new quotatios quot3 including all elements of quot1 that do not satisfy predicate quot2 (i.e. the opposite of filter)", - "input": "quot1 quot2", - "name": "reject", - "output": "quot3" - }, - "remove": { - "description": "Returns the _n^th_ element of quot1 (zero-based), and returns the modified copy of the quotation quot2.", - "input": "quot1 int", - "name": "remove", - "output": "quot2" - }, - "rest": { - "description": "Returns a new quotation quot2 containing all elements of quot1 quotation except for the first.", - "input": "quot1", - "name": "rest", - "output": "quot2" - }, - "reverse": { - "description": "Returns a new quotation quot2 containing all elements of quot1 in reverse order.", - "input": "quot1", - "name": "reverse", - "output": "quot2" + "sin": { + "description": "Calculates the sine of num1 (in radians).", + "kind": "symbol", + "name": "sin", + "signature": "num1 ==> num2" }, - "set": { - "description": "Sets the value of the _n^th_ element quot1 (zero-based) to a, and returns the modified copy of the quotation quot2.", - "input": "quot1 a int", - "name": "set", - "output": "quot2" + "sinh": { + "description": "Calculates the hyperbolic sine of num1 (in radians).", + "kind": "symbol", + "name": "sinh", + "signature": "num1 ==> num2" }, - "shorten": { - "description": "Returns a quotation quot2 containing the first _n_ values of the input quotation quot1.", - "input": "quot1 int", - "name": "shorten", - "output": "quot2" + "sip": { + "description": "Saves the a1, dequotes a2, and restores a1.", + "kind": "symbol", + "name": "sip", + "signature": "a1 (a2) ==> a* a1" }, "size": { "description": "Returns the length of quot.", - "input": "quot", + "kind": "symbol", "name": "size", - "output": "int" + "signature": "quot ==> int" + }, + "sleep": { + "description": "Halts program execution for int milliseconds.", + "kind": "symbol", + "name": "sleep", + "signature": "int ==> " }, "slice": { "description": "Creates a new quotation quot2 obtaining by selecting all elements of quot1 between indexes int1 and int2.\n \n \n Example\n \n The following program leaves (3 4 5) on the stack:\n \n (1 2 3 4 5 6) \n 2 4 slice", - "input": "quot1 int1 int2", + "kind": "symbol", "name": "slice", - "output": "quot2" + "signature": "quot1 int1 int2 ==> quot2" + }, + "socket": { + "description": "Opens a new socket.\n \n dict can be empty or contain any of the following properties, used to specify the domain, type and protocol of the socket respectively.\n \n domain\n : The socket domain. It can be set to one of the following values:\n \n * **ipv4** (default): Internet Protocol version 4.\n * **ipv6**: Internet Protocol version 6.\n * **unix**: local Unix file (not supported on Windows systems).\n type\n : The socket type. It can be set to one of the following values:\n \n * **stream** (default): Reliable stream-oriented service or Stream Socket.\n * **dgram**: Datagram service or Datagram Socket.\n * **raw**: Raw protocols atop the network layer.\n * **seqpacket**: Reliable sequenced packet service.\n protocol\n : The socket protocol. It can be set to one of the following values:\n \n * **tcp** (default): Transmission Control Protocol.\n * **udp**: User Datagram Protocol.\n * **ipv4**: Internet Protocol version 4 (not supported on Windows systems).\n * **ipv6**: Internet Protocol version 6 (not supported on Windows systems).\n * **raw**: Raw IP Packets protocol (not supported on Windows systems).\n * **icmp**: Internet Control Message Protocol (not supported on Windows systems).", + "kind": "symbol", + "name": "socket", + "signature": "dict ==> dict:socket" }, "sort": { "description": "Sorts all elements of quot1 according to predicate quot2. \n \n \n Example\n \n The following program leaves (1 3 5 7 9 13 16) on the stack:\n \n (1 9 5 13 16 3 7) ' sort", - "input": "quot1 quot2", + "kind": "symbol", "name": "sort", - "output": "quot3" + "signature": "quot1 quot2 ==> quot3" }, - "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", - "input": "quot1 quot2", - "name": "symmetric-difference", - "output": "quot3" + "source": { + "description": "Display the source code of symbol 'sym (if it has been implemented a min quotation).", + "kind": "symbol", + "name": "source", + "signature": "'sym ==> quot" }, - "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.", - "input": "quot1 int", - "name": "take", - "output": "quot2" + "split": { + "description": "Splits 'sym1 using separator 'sym2 and returns the resulting strings within the quotation quot.", + "kind": "symbol", + "name": "split", + "signature": "'sym1 'sym2 ==> quot" }, - "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", - "input": "quot1 quot2", - "name": "union", - "output": "quot3" - } - }, - "stack": { - "clear-stack": { - "description": "Empties the stack.", - "input": "a", - "name": "clear-stack", - "output": "" + "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", + "name": "spread", + "signature": "a* (quot*) ==> a*" }, - "cleave": { - "description": "Applies each quotation contained in the first element to the second element a1.\n \n Example\n \n The following program leaves 2 on the stack:\n \n (1 2 3) ((sum) (size)) cleave /", - "input": "a1 (quot*)", - "name": "cleave", - "output": "a*" + "sqrt": { + "description": "Returns square root of num1.", + "kind": "symbol", + "name": "sqrt", + "signature": "num1 ==> num2" }, - "cons": { - "description": "Prepends a1 to the quotation on top of the stack.", - "input": "a1 (a*)", - "name": "cons", - "output": "(a1 a*)" + "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: [request &rArr; 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", + "name": "start-server", + "signature": "dict ==> " }, - "dip": { - "description": "Removes the first and second element from the stack, dequotes the first element, and restores the second element.", - "input": "a1 (a2)", - "name": "dip", - "output": "a* a1" + "stop-server": { + "description": "Stops the currently-running HTTP server. This operator should be used within an HTTP server handler quotation.", + "kind": "symbol", + "name": "stop-server", + "signature": " ==> " }, - "dup": { - "description": "Duplicates the first element on the stack.", - "input": "a1", - "name": "dup", - "output": "a1 a1" - }, - "get-stack": { - "description": "Puts a quotation containing the contents of the stack on the stack.", - "input": "", - "name": "get-stack", - "output": "(a*)" - }, - "id": { - "description": "Does nothing.", - "input": "", - "name": "id", - "output": "" - }, - "keep": { - "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\n \n Example\n \n The following program leaves 5 3 on the stack:\n \n 2 3 '+ keep", - "input": "a1 quot", - "name": "keep", - "output": "a* a1" - }, - "nip": { - "description": "Removes the second element from the stack.", - "input": "a1 a2", - "name": "nip", - "output": "a2" - }, - "over": { - "description": "Pushes a copy of the second element on top of the stack.", - "input": "a1 a2", - "name": "over", - "output": "a1 a2 a1" + "string": { + "description": "Converts a to its string representation.", + "kind": "symbol", + "name": "string", + "signature": "a ==> string" }, - "pick": { - "description": "Pushes a copy of the third element on top of the stack.", - "input": "a1 a2 a3", - "name": "pick", - "output": "a1 a2 a3 a1" + "string?": { + "description": "Returns true if a is a string, false otherwise.", + "kind": "symbol", + "name": "string?", + "signature": "a ==> bool" }, - "pop": { - "description": "Removes the first element from the stack.", - "input": "a", - "name": "pop", - "output": "" + "stringlike?": { + "description": "Returns true if a is a string or a quoted symbol, false otherwise.", + "kind": "symbol", + "name": "stringlike?", + "signature": "a ==> bool" }, - "rolldown": { - "description": "Moves the third element in first position, the second in third position and the the first in second position.", - "input": "a1 a2 a3", - "name": "rolldown", - "output": "a2 a3 a1" + "strip": { + "description": "Returns string, which is set to 'sym with leading and trailing spaces removed.", + "kind": "symbol", + "name": "strip", + "signature": "'sym ==> string" }, - "rollup": { - "description": "Moves the third and second element into second and third position and moves the first element into third position.", - "input": "a1 a2 a3", - "name": "rollup", - "output": "a3 a2 a1" + "substr": { + "description": "Returns a substring string2 obtained by retriving int2 characters starting from index int1 within string1.", + "kind": "symbol", + "name": "substr", + "signature": "string1 int1 int2 ==> string2" }, - "set-stack": { - "description": "Substitute the existing stack with the contents of quot.", - "input": "quot", - "name": "set-stack", - "output": "a*" + "succ": { + "description": "Returns the successor of int1.", + "kind": "symbol", + "name": "succ", + "signature": "int1 ==> int2" }, - "sip": { - "description": "Saves the a1, dequotes a2, and restores a1.", - "input": "a1 (a2)", - "name": "sip", - "output": "a* a1" + "suffix": { + "description": "Appends 'sym2 to 'sym1.", + "kind": "symbol", + "name": "suffix", + "signature": "'sym1 'sym2 ==> string" }, - "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", - "input": "a* (quot*)", - "name": "spread", - "output": "a*" + "sum": { + "description": "Returns the sum of all items of quot. quot is a quotation of integers.", + "kind": "symbol", + "name": "sum", + "signature": "quot ==> int" }, "swap": { "description": "Swaps the first two elements on the stack.", - "input": "a1 a2", + "kind": "symbol", "name": "swap", - "output": "a2 a1" + "signature": "a1 a2 ==> a2 a1" }, "swons": { "description": "Prepends a1 to the quotation that follows it.", - "input": "(a*) a1", + "kind": "symbol", "name": "swons", - "output": "(a1 a*)" - } - }, - "str": { - "apply-interpolate": { - "description": "The same as pushing apply and then interpolate on the stack.", - "input": "string quot", - "name": "apply-interpolate", - "output": "string" + "signature": "(a*) a1 ==> (a1 a*)" }, - "capitalize": { - "description": "Returns a copy of 'sym with the first character capitalized.", - "input": "'sym", - "name": "capitalize", - "output": "string" + "symbols": { + "description": "Returns a list of all symbols defined in the [ROOT](class:kwd) scope.", + "kind": "symbol", + "name": "symbols", + "signature": " ==> (string*)" }, - "chr": { - "description": "Returns the single character string obtained by interpreting int as an ASCII code.", - "input": "int", - "name": "chr", - "output": "string" + "symlink": { + "description": "Creates symlink 'sym2 for file or directory 'sym1.", + "kind": "symbol", + "name": "symlink", + "signature": "'sym1 'sym2 ==> " }, - "escape": { - "description": "Returns a copy of 'sym with quotes and backslashes escaped with a backslash.", - "input": "'sym", - "name": "escape", - "output": "string" + "symlink?": { + "description": "Returns true if the specified path 'sym exists and is a symbolic link.", + "kind": "symbol", + "name": "symlink?", + "signature": "'sym ==> bool" }, - "from-semver": { - "description": "Given a basic [SemVer](https://semver.org)-compliant string (with no additional labels) string, \nit pushes a dictionary dict on the stack containing a **major**, **minor**, and **patch** key/value pairs.", - "input": "string", - "name": "from-semver", - "output": "dict" + "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", + "name": "symmetric-difference", + "signature": "quot1 quot2 ==> quot3" }, - "indent": { - "description": "Returns string containing 'sym indented with int spaces.", - "input": "'sym int", - "name": "indent", - "output": "string" + "system": { + "description": "Executes the external command 'sym in the current directory and pushes its return code on the stack.", + "kind": "symbol", + "name": "system", + "signature": "'sym ==> int" }, - "indexof": { - "description": "If string2 is contained in string1, returns the index of the first match or -1 if no match is found.", - "input": "string1 string2", - "name": "indexof", - "output": "int" + "system!": { + "description": "Executes the external command 'sym in the current directory without pushing its return code on the stack.", + "kind": "symbol", + "name": "system!", + "signature": "'sym ==> " }, - "join": { - "description": "Joins the elements of quot using separator 'sym, producing string.", - "input": "quot 'sym", - "name": "join", - "output": "string" + "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", + "name": "take", + "signature": "quot1 int ==> quot2" }, - "length": { - "description": "Returns the length of 'sym.", - "input": "'sym", - "name": "length", - "output": "int" + "tan": { + "description": "Calculates the tangent of num1 (in radians).", + "kind": "symbol", + "name": "tan", + "signature": "num1 ==> num2" }, - "lowercase": { - "description": "Returns a copy of 'sym converted to lowercase.", - "input": "'sym", - "name": "lowercase", - "output": "string" + "tanh": { + "description": "Calculates the hyperbolic tangent of num1 (in radians).", + "kind": "symbol", + "name": "tanh", + "signature": "num1 ==> num2" }, - "match": { - "description": "Returns true if string2 matches string1, false otherwise.\n \n Tip\n \n string2 can be a sgregex-compatible regular expression.", - "input": "string1 string2", - "name": "match", - "output": "bool" + "tap": { + "description": "Performs the following operations:\n \n 1. Removes a from the stack.\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\n 1. Pushes a back to the stack.\n 2. Dequotes the quotation and saves the result as a.\n 3. Push the resulting a back on the stack.\n \n \n Example\n \n The following program:\n \n {1 :a 2 :b 3 :c} (\n (dup /a succ succ b)\n ) tap\n \n Returns {3 :a 3 :b 3 :c}.", + "kind": "symbol", + "name": "tap", + "signature": "a quot ==> a" }, - "ord": { - "description": "Returns the ASCII code int corresponding to the single character string.", - "input": "string", - "name": "ord", - "output": "int" + "tap!": { + "description": "Performs the following operations:\n \n 1. Removes a from the stack.\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\n 1. Pushes a back to the stack.\n 2. Dequotes the quotation and saves the result as a.\n \n \n Example\n \n The following program:\n \n \"\" :s1\n \"test\" (\n (' \"1\" swap append \"\" join)\n (' \"2\" swap append \"\" join)\n (' \"3\" swap append \"\" join @s1 s1)\n ) tap!\n \n Sets s1 to \"test123\".", + "kind": "symbol", + "name": "tap!", + "signature": "a quot ==> a" }, - "parse-url": { - "description": "Parses the url string into its components and stores them into url.", - "input": "string", - "name": "parse-url", - "output": "url" + "tau": { + "description": "Returns the value of the &tau; constant (2&pi;).", + "kind": "symbol", + "name": "tau", + "signature": " ==> num" }, - "prefix": { - "description": "Prepends 'sym2 to 'sym1.", - "input": "'sym1 'sym2", - "name": "prefix", - "output": "string" + "timeinfo": { + "description": "Returns a timeinfo dictionary from timestamp int.", + "kind": "symbol", + "name": "timeinfo", + "signature": "int ==> dict:timeinfo" }, - "regex": { - "description": "Performs a search and/or a search-and-replace operation using pattern string2.\n \n string2 can be one of the following patterns:\n \n * **/**_search-regex_**/**_modifiers_\n * **s/**_search-regex_**/**_replacemenet_**/**_modifiers_\n \n quot is always a quotation containing:\n \n * One or more strings containing the first match and captures (if any), like for the search operator.\n * A string containing the resuling string after the search-and-replace operation.\n \n \n Tip\n \n * _search-regex_ can be a sgregex-compatible regular expression.\n * _modifiers_ are optionals can contain one or more of the following characters, in any order:\n * **i**: case-insensitive match.\n * **m**: multi-line match.\n * **s**: dot character includes newlines.\n \n \n Example: Search\n \n The following:\n \n \"This is a GOOD idea.\" \"/(good) idea/i\" regex\n \n produces: (\"GOOD idea\", \"GOOD\")\n \n \n Example: Search and Replace\n \n The following:\n \n \"This is a GOOD idea.\" \"s/good/bad/i\" regex\n \n produces: (\"This is a bad idea\")", - "input": "string1 string2", - "name": "regex", - "output": "quot" + "times": { + "description": "Applies the quotation quot int times.", + "kind": "symbol", + "name": "times", + "signature": "quot int ==> a*" }, - "repeat": { - "description": "Returns string containing 'sym repeated int times.", - "input": "'sym int", - "name": "repeat", - "output": "string" - }, - "replace": { - "description": "Returns a copy of string1 containing all occurrences of string2 replaced by string3\n \n Tip\n \n string2 can be a sgregex-compatible regular expression.\n \n \n Example\n \n The following:\n \n \"This is a stupid test. Is it really a stupid test?\" \" s[a-z]+\" \" simple\" replace\n \n produces:\n \n \"This is a simple test. Is it really a simple test?\"", - "input": "string1 string2 string3", - "name": "replace", - "output": "string4" - }, - "search": { - "description": "Returns a quotation of quotations (like the one returned by the search operator) containing all occurrences of string2 within string1.", - "input": "string1 string2", - "name": "search", - "output": "quot" - }, - "semver-inc-major": { - "description": "Increments the major digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", - "input": "string1", - "name": "semver-inc-major", - "output": "string2" - }, - "semver-inc-minor": { - "description": "Increments the minor digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", - "input": "string1", - "name": "semver-inc-minor", - "output": "string2" - }, - "semver-inc-patch": { - "description": "Increments the patch digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", - "input": "string1", - "name": "semver-inc-patch", - "output": "string2" - }, - "semver?": { - "description": "Checks whether string is a [SemVer](https://semver.org)-compliant version or not.", - "input": "string", - "name": "semver?", - "output": "bool" - }, - "split": { - "description": "Splits 'sym1 using separator 'sym2 and returns the resulting strings within the quotation quot.", - "input": "'sym1 'sym2", - "name": "split", - "output": "quot" - }, - "strip": { - "description": "Returns string, which is set to 'sym with leading and trailing spaces removed.", - "input": "'sym", - "name": "strip", - "output": "string" - }, - "substr": { - "description": "Returns a substring string2 obtained by retriving int2 characters starting from index int1 within string1.", - "input": "string1 int1 int2", - "name": "substr", - "output": "string2" - }, - "suffix": { - "description": "Appends 'sym2 to 'sym1.", - "input": "'sym1 'sym2", - "name": "suffix", - "output": "string" + "timestamp": { + "description": "Returns the current time as Unix timestamp.", + "kind": "symbol", + "name": "timestamp", + "signature": " ==> int" }, "titleize": { "description": "Returns a copy of 'sym in which the first character of each word is capitalized.", - "input": "'sym", + "kind": "symbol", "name": "titleize", - "output": "string" + "signature": "'sym ==> string" + }, + "to-json": { + "description": "Converts a into a JSON string.", + "kind": "symbol", + "name": "to-json", + "signature": "a ==> string" }, "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) string on the stack.", - "input": "dict", + "kind": "symbol", "name": "to-semver", - "output": "string" + "signature": "dict ==> string" + }, + "to-timestamp": { + "description": "Converts the timeinfo dictionary dict:timeinfo to the corresponding Unix timestamp.", + "kind": "symbol", + "name": "to-timestamp", + "signature": "dict:timeinfo ==> int" + }, + "to-yaml": { + "description": "Converts a into a YAML string.\n\n \n Note\n \n At present, only min dictionaries containing string values are supported.", + "kind": "symbol", + "name": "to-yaml", + "signature": "a ==> string" + }, + "trunc": { + "description": "Truncates num to the decimal point.", + "kind": "symbol", + "name": "trunc", + "signature": "num1 ==> num2" }, - "uppercase": { - "description": "Returns a copy of 'sym converted to uppercase.", - "input": "'sym1", - "name": "uppercase", - "output": "'sym2" - } - }, - "sys": { - ".": { - "description": "Returns the full path to the current directory.", - "input": "", - "name": ".", - "output": "string" + "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", + "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", + "name": "type", + "signature": "a ==> string" }, - "..": { - "description": "Returns the full path to the parent directory.", - "input": "", - "name": "..", - "output": "string" + "type?": { + "description": "Returns true if the data type of a is the specified type 'sym, false otherwise.", + "kind": "symbol", + "name": "type?", + "signature": "a 'sym ==> bool" }, - "cd": { - "description": "Change the current directory to 'sym.", - "input": "'sym", - "name": "cd", - "output": "" + "typeclass": { + "description": "Defines a new type class 'sym set to quotation quot, which can be used in operator signatures.\n \n \n Example\n \n Consider the following type class which defines a natural number: \n\n (:n ((n integer?) (n 0 )) &&) 'natural typeclass\n \n It can now be used in operator signatures, like this:\n \n (\n symbol natural-sum\n (natural :n natural :m == natural :result)\n (n m + @result)\n ) ::", + "kind": "symbol", + "name": "typeclass", + "signature": "quot 'sym ==> " }, - "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", - "input": "'sym int", - "name": "chmod", - "output": "" + "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", + "name": "union", + "signature": "quot1 quot2 ==> quot3" }, - "cp": { - "description": "Copies the file or directory 'sym1 to 'sym2.", - "input": "'sym1 'sym2", - "name": "cp", - "output": "" + "unless": { + "description": "If 1 evaluates to false then evaluates 2.", + "kind": "symbol", + "name": "unless", + "signature": "quot1 quot2 ==> a*" }, - "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.", - "input": "", - "name": "cpu", - "output": "string" + "unmapkey": { + "description": "Unmaps a previously-mapped key or key-combination 'sym, restoring the default mapping if available.\n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * At present, all the default mappings of min are those provided by the [nimline](https://h3rald.com/nimline/nimline.html) library.", + "kind": "symbol", + "name": "unmapkey", + "signature": "'sym ==> " }, - "dir?": { - "description": "Returns true if the specified path 'sym exists and is a directory.", - "input": "'sym", - "name": "dir?", - "output": "bool" + "unseal": { + "description": "Unseals the user-defined symbol 'sym, so that it can be re-assigned.", + "kind": "symbol", + "name": "unseal", + "signature": "'sym ==> " }, - "dirname": { - "description": "Returns the path of the directory containing path 'sym.", - "input": "'sym", - "name": "dirname", - "output": "string" + "unseal-sigil": { + "description": "Unseals sigil 'sym, so that it can be re-defined (system sigils cannot be unsealed).", + "kind": "symbol", + "name": "unseal-sigil", + "signature": "'sym ==> " }, - "env?": { - "description": "Returns true if environment variable 'sym exists, false otherwise.", - "input": "'sym", - "name": "env?", - "output": "bool" + "unzip": { + "description": "Decompresses zip file 'sym1 to directory 'sym2 (created if not present).", + "kind": "symbol", + "name": "unzip", + "signature": "'sym1 'sym2 ==> " }, - "exists?": { - "description": "Returns true if the specified file or directory 'sym exists.", - "input": "'sym", - "name": "exists?", - "output": "bool" + "uppercase": { + "description": "Returns a copy of 'sym converted to uppercase.", + "kind": "symbol", + "name": "uppercase", + "signature": "'sym1 ==> 'sym2" }, - "file?": { - "description": "Returns true if the specified path 'sym exists and is a file.", - "input": "'sym", - "name": "file?", - "output": "bool" + "version": { + "description": "Returns the current min version number.", + "kind": "symbol", + "name": "version", + "signature": " ==> string" }, - "filename": { - "description": "Returns the file name of path 'sym.", - "input": "'sym", - "name": "filename", - "output": "string" + "warning": { + "description": "Prints a and a new line to STDERR, if logging level is set to [warning](class:kwd) or lower.", + "kind": "symbol", + "name": "warning", + "signature": "a ==> a" }, - "get-env": { - "description": "Returns environment variable 'sym.", - "input": "'sym", - "name": "get-env", - "output": "string" + "warning!": { + "description": "Prints a (removing it from the stack) and a new line to STDERR, if logging level is set to [warning](class:kwd) or lower.", + "kind": "symbol", + "name": "warning!", + "signature": "a ==> " }, - "hardlink": { - "description": "Creates hardlink 'sym2 for file or directory 'sym1.", - "input": "'sym1 'sym2", - "name": "hardlink", - "output": "" + "when": { + "description": "If quot1 evaluates to true then evaluates quot2.", + "kind": "symbol", + "name": "when", + "signature": "quot1 quot2 ==> a*" }, - "ls": { - "description": "Returns a quotation quot containing all children (files and directories) of the directory 'sym.", - "input": "'sym", - "name": "ls", - "output": "quot" + "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", + "name": "which", + "signature": "'sym ==> string" }, - "ls-r": { - "description": "Returns a quotation quot containing all children (files and directories) of the directory 'sym, recursively.", - "input": "'sym", - "name": "ls-r", - "output": "quot" + "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", + "name": "while", + "signature": "quot1 quot2 ==> a*" }, - "mkdir": { - "description": "Creates the specified directory 'sym.", - "input": "'sym", - "name": "mkdir", - "output": "" + "with": { + "description": "Pushes each item of quot1 on the stack using the scope of quot2 as scope. \n\n \n Example\n \n This operator is useful to define symbols on the [ROOT](class:kwd) scope or another scope. For example min's prelude includes the following code used to import certain modules only if min was not compiled in lite mode:\n \n 'lite? (\n (\n 'crypto import\n 'math import\n 'net import\n 'http import\n ) ROOT with\n ) unless", + "kind": "symbol", + "name": "with", + "signature": "quot1 quot2 ==> a*" }, - "mv": { - "description": "Moves the file or directory 'sym1 to 'sym2.", - "input": "'sym1 'sym2", - "name": "mv", - "output": "" + "xor": { + "description": "Returns true if bool1 and bool2 are different, false otherwise.", + "kind": "symbol", + "name": "xor", + "signature": "bool1 bool2 ==> bool3" }, - "os": { - "description": "Returns the host operating system. It can be one of the following strings: windows, macosx, linux, netbsd, freebsd, openbsd, solaris, aix, standalone.", - "input": "", - "name": "os", - "output": "string" + "zip": { + "description": "Compresses files included in quotation quot into zip file 'sym.", + "kind": "symbol", + "name": "zip", + "signature": "'sym quot ==> " + } + }, + "sigils": { + "!": { + "description": "See system", + "kind": "symbol", + "name": "!" }, - "put-env": { - "description": "Sets environment variable 'sym2 to 'sym1.", - "input": "'sym1 'sym2", - "name": "put-env", - "output": "string" + "#": { + "description": "See quote-bind", + "kind": "symbol", + "name": "#" }, - "rm": { - "description": "Deletes the specified file 'sym.", - "input": "'sym", - "name": "rm", - "output": "" + "$": { + "description": "See get-env", + "kind": "symbol", + "name": "$" }, - "rmdir": { - "description": "Deletes the specified directory 'sym and all its subdirectories recursively.", - "input": "'sym", - "name": "rmdir", - "output": "" + "%": { + "description": "See dset", + "kind": "symbol", + "name": "%" }, - "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).", - "input": "'sym", - "name": "run", - "output": "dict" + "&": { + "description": "See run", + "kind": "symbol", + "name": "&" }, - "sleep": { - "description": "Halts program execution for int milliseconds.", - "input": "int", - "name": "sleep", - "output": "" + "'": { + "description": "See quote", + "kind": "symbol", + "name": "'" }, - "symlink": { - "description": "Creates symlink 'sym2 for file or directory 'sym1.", - "input": "'sym1 'sym2", - "name": "symlink", - "output": "" + "*": { + "description": "See invoke", + "kind": "symbol", + "name": "*" }, - "symlink?": { - "description": "Returns true if the specified path 'sym exists and is a symbolic link.", - "input": "'sym", - "name": "symlink?", - "output": "bool" + "+": { + "description": "See module", + "kind": "symbol", + "name": "+" }, - "system": { - "description": "Executes the external command 'sym in the current directory and pushes its return code on the stack.", - "input": "'sym", - "name": "system", - "output": "int" + "/": { + "description": "See dget", + "kind": "symbol", + "name": "/" }, - "system!": { - "description": "Executes the external command 'sym in the current directory without pushing its return code on the stack.", - "input": "'sym", - "name": "system!", - "output": "" + ":": { + "description": "See define", + "kind": "symbol", + "name": ":" }, - "unzip": { - "description": "Decompresses zip file 'sym1 to directory 'sym2 (created if not present).", - "input": "'sym1 'sym2", - "name": "unzip", - "output": "" + "<": { + "description": "See load-symbol", + "kind": "symbol", + "name": "<" }, - "which": { - "description": "Returns the full path to the directory containing executable 'sym, or an empty string if the executable is not found in **$PATH**.", - "input": "'sym", - "name": "which", - "output": "string" + "=": { + "description": "See quote-define", + "kind": "symbol", + "name": "=" }, - "zip": { - "description": "Compresses files included in quotation quot into zip file 'sym.", - "input": "'sym quot", - "name": "zip", - "output": "" - } - }, - "time": { - "datetime": { - "description": "Returns an ISO 8601 string representing the combined date and time in UTC of timestamp int.", - "input": "int", - "name": "datetime", - "output": "string" + ">": { + "description": "See save-symbol", + "kind": "symbol", + "name": ">" }, - "now": { - "description": "Returns the current time as Unix timestamp with microseconds.", - "input": "", - "name": "now", - "output": "float" + "?": { + "description": "See help", + "kind": "symbol", + "name": "?" }, - "timeinfo": { - "description": "Returns a timeinfo dictionary from timestamp int.", - "input": "int", - "name": "timeinfo", - "output": "dict:timeinfo" + "@": { + "description": "See bind", + "kind": "symbol", + "name": "@" }, - "timestamp": { - "description": "Returns the current time as Unix timestamp.", - "input": "", - "name": "timestamp", - "output": "int" + "^": { + "description": "See call", + "kind": "symbol", + "name": "^" }, - "to-timestamp": { - "description": "Converts the timeinfo dictionary dict:timeinfo to the corresponding Unix timestamp.", - "input": "dict:timeinfo", - "name": "to-timestamp", - "output": "int" + "~": { + "description": "See delete", + "kind": "symbol", + "name": "~" } } }
M min.nimmin.nim

@@ -60,7 +60,6 @@ export minilogger

else: export niftylogger - const PRELUDE* = "prelude.min".slurp.strip var NIMOPTIONS* = "" var MINMODULES* = newSeq[string](0)

@@ -94,6 +93,8 @@ 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("#"):
M minpkg/lib/min_lang.nimminpkg/lib/min_lang.nim

@@ -31,6 +31,9 @@ let def = i.scope

when not defined(mini): + const HELPFILE = "../../help.json".slurp + let HELP = HELPFILE.parseJson + def.symbol("from-json") do (i: In): let vals = i.expect("string") let s = vals[0]

@@ -547,6 +550,11 @@ var doc = i.fromJson(sym.doc)

doc.objType = "help" i.push doc return + elif not defined(mini) and HELP["operators"].hasKey(s): + var doc = i.fromJson(HELP["operators"][s]) + doc.objType = "help" + i.push doc + return i.push nil.newVal def.symbol("sigil-help") do (i: In):

@@ -555,7 +563,14 @@ let s = vals[0].getString

if i.scope.hasSigil(s): let sym = i.scope.getSigil(s) if not sym.doc.isNil and sym.doc.kind == JObject: - i.push i.fromJson(sym.doc) + var doc = i.fromJson(sym.doc) + doc.objType = "help" + i.push doc + return + elif not defined(mini) and HELP["operators"].hasKey(s): + var doc =i.fromJson(HELP["operators"][s]) + doc.objType = "help" + i.push doc return i.push nil.newVal

@@ -568,7 +583,8 @@ var found = false

var foundDoc = false let displayDoc = proc (j: JsonNode) = echo "=== $# [$#]" % [j["name"].getStr, j["kind"].getStr] - echo j["signature"].getStr + if j.hasKey("signature"): + echo j["signature"].getStr if j.hasKey("description"): let desc = j["description"].getStr if desc.len != 0:

@@ -582,12 +598,18 @@ let sym = i.scope.getSymbol(s)

if not sym.doc.isNil and sym.doc.kind == JObject: foundDoc = true displayDoc(sym.doc) + elif not defined(mini) and HELP["operators"].hasKey(s): + foundDoc = true + displayDoc HELP["operators"][s] if i.scope.hasSigil(s): found = true let sym = i.scope.getSigil(s) if not sym.doc.isNil and sym.doc.kind == JObject: foundDoc = true displayDoc(sym.doc) + elif not defined(mini) and HELP["sigils"].hasKey(s): + foundDoc = true + displayDoc HELP["sigils"][s] if not found: warn "Undefined symbol or sigil: $#" % s elif not foundDoc:
M next-release.mdnext-release.md

@@ -7,3 +7,4 @@ * Refactored tasks as required modules.

* Added binary operators to num module (thanks @drkameleon!). * Added **product**, **med**, **avg** and **range** operators to num module (thanks @drkameleon!). * Added Dockerfile (thanks @drkameleon!). +* Implemented integrated help system for all native symbols.
M site/contents/reference-lang.mdsite/contents/reference-lang.md

@@ -26,25 +26,25 @@ {#sig||?||help#}

{#alias||?||help#} -{#sig||*||invoke#} +{#sig||&ast;||invoke#} {#sig||@||bind#} {#alias||@||bind#} -{#sig||>||save-symbol#} +{#sig||&gt;||save-symbol#} -{#sig||<||load-symbol#} +{#sig||&lt;||load-symbol#} {#alias||->||dequote#} -{#alias||>>||prefix-dequote#} +{#alias||&gt;&gt;||prefix-dequote#} -{#alias||><||infix-dequote#} +{#alias||&gt;&lt;||infix-dequote#} -{#alias||=>||apply#} +{#alias||=&gt;||apply#} -{#op||==>||{{none}}||{{none}}|| +{#op||==&gt;||{{none}}||{{none}}|| Symbol used to separate input and output calues in operator signatures.#} {#alias||=-=||expect-empty-stack#}
M site/contents/reference-num.mdsite/contents/reference-num.md

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

{#op||-inf||{{none}}||{{n}}|| Returns negative infinity. #} -{#op||\*||{{n1}} {{n2}}||{{n3}}|| +{#op||&ast;||{{n1}} {{n2}}||{{n3}}|| Multiplies {{n1}} by {{n2}}. #} {#op||/||{{n1}} {{n2}}||{{n3}}||
M site/contents/reference-sys.mdsite/contents/reference-sys.md

@@ -8,11 +8,11 @@ {#sig||$||get-env#}

{#alias||$||get-env#} -{#sig||\!||system#} +{#sig||&excl;||system#} -{#alias||\!||system#} +{#alias||&excl;||system#} -{#alias||\!\!||system!#} +{#alias||&excl;&excl;||system!#} {#sig||&||run#}
M tasks/help.mintasks/help.min

@@ -1,12 +1,28 @@

"tasks/data/doc-snippets.json" fread from-json :snippets "site/contents" ls ("reference-" match) filter =src-files "\{\#op\|\|([^|]+)\|\|([^|]+)\|\|([^|]+)\|\|([^#])+\#\}" :op-regex +"\{\#sig\|\|([^|]+)\|\|([^#]+)\#\}" :sig-regex +"\{\#alias\|\|([^|]+)\|\|([^#]+)\#\}" :alias-regex "\{\\{([^}]+)\}\}" :snippet-regex ">( >)*" :block-regex "%([^%]+)%" :title-regex "\{@[^@]+@\}" :incl-regex "`([^`]+)`" :code-regex +( + symbol fix-name + (string :s ==> string :result) + ( + s + "&excl;" (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 (string :s ==> string :result)

@@ -47,34 +63,81 @@ symbol process-op

(quot :matches ==> dict :data) ( {} - matches 1 get process %name - matches 2 get process %input - matches 3 get process %output + matches 1 get process fix-name %name + matches 2 get process :input + matches 3 get process :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 - "Generating: $#" (mod-id) =% notice! - {} :mod-dict - file fread op-regex search-all ( + "Processing: $#" (mod-id) =% notice! + file fread :contents + contents op-regex search-all ( process-op :op op /name :op-name - mod-dict + op-dict op op-name dset - @mod-dict + @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-alias :sig + sig /name :sig-name + sig-dict + sig sig-name dset + @sig-dict ) foreach ref-dict - mod-dict mod-id dset + op-dict %operators + sig-dict %sigils @ref-dict ) foreach "Writing help.json" notice!