Addressing some language inconsistencies.
jump to
@@ -69,13 +69,13 @@ ".": {
"description": "Returns the full path to the current directory.", "kind": "symbol", "name": ".", - "signature": " ==> string" + "signature": " ==> str" }, "..": { "description": "Returns the full path to the parent directory.", "kind": "symbol", "name": "..", - "signature": " ==> string" + "signature": " ==> str" }, "/": { "description": "Divides num1 by num2.",@@ -94,13 +94,13 @@ "kind": "symbol",
"name": "::" }, "<": { - "description": "Returns true if a1 is smaller than a2, false otherwise. \n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is smaller than a2, false otherwise. \r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": "<", "signature": "a1 a2 ==> bool" }, "<=": { - "description": "Returns true if a1 is smaller than or equal to a2, false otherwise.\n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is smaller than or equal to a2, false otherwise.\r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": "<=", "signature": "a1 a2 ==> bool"@@ -143,7 +143,7 @@ "kind": "symbol",
"name": "=~" }, ">": { - "description": "Returns true if a1 is greater than a2, false otherwise. \n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is greater than a2, false otherwise. \r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": ">", "signature": "a1 a2 ==> bool"@@ -154,7 +154,7 @@ "kind": "symbol",
"name": "><" }, ">=": { - "description": "Returns true if a1 is greater than or equal to a2, false otherwise.\n \n Note\n \n Only comparisons among two numbers or two strings are supported.", + "description": "Returns true if a1 is greater than or equal to a2, false otherwise.\r\n \r\n Note\r\n \r\n Only comparisons among two numbers or two strings are supported.", "kind": "symbol", "name": ">=", "signature": "a1 a2 ==> bool"@@ -175,16 +175,11 @@ "kind": "symbol",
"name": "@" }, "ROOT": { - "description": "Returns a module holding a reference to the [ROOT](class:kwd) scope.\n\n \n Tip\n \n This symbol is very useful in conjunction with the **with** operator.", + "description": "Returns a module holding a reference to the [ROOT](class:kwd) scope.\r\n\r\n \r\n Tip\r\n \r\n This symbol is very useful in conjunction with the **with** operator.", "kind": "symbol", "name": "ROOT", "signature": " ==> dict" }, - "^": { - "description": "See call", - "kind": "symbol", - "name": "^" - }, "abs": { "description": "Calculates tbe absolute value of num1.", "kind": "symbol",@@ -207,7 +202,7 @@ "aes": {
"description": "Encrypts or decrypts 'sym1 using the Advanced Encryption Standard (AES) in CTR mode, using 'sym2 as password.", "kind": "symbol", "name": "aes", - "signature": "'sym1 'sym2 ==> string" + "signature": "'sym1 'sym2 ==> str" }, "all?": { "description": "Applies predicate quot2 to each element of quot1 and returns true if all elements of quot1 satisfy predicate quot2, false otherwise.",@@ -243,7 +238,7 @@ "apply-interpolate": {
"description": "The same as pushing apply and then interpolate on the stack.", "kind": "symbol", "name": "apply-interpolate", - "signature": "string quot ==> string" + "signature": "str quot ==> str" }, "args": { "description": "Returns a list of all arguments passed to the current program.",@@ -258,10 +253,10 @@ "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.", + "description": "Prints str1 (prompt), reads a line from STDIN and places it on top of the stack as a string.", "kind": "symbol", "name": "ask", - "signature": "string1 ==> string2" + "signature": "str1 ==> str2" }, "atan": { "description": "Calculates the arc tangent of num1 (in radians).",@@ -273,7 +268,7 @@ "atime": {
"description": "Returns a timestamp corresponding to the time that file/directory 'sym was last accessed.", "kind": "symbol", "name": "atime", - "signature": "'sym ==> float" + "signature": "'sym ==> flt" }, "avg": { "description": "Returns the average of the items of quot.",@@ -312,7 +307,7 @@ "name": "bitxor",
"signature": "int1 int2 ==> int3" }, "bool": { - "description": "Converts a to a boolean value based on the following rules:\n \n * If a is a boolean value, no conversion is performed.\n * If a is null, it is converted to false .\n * If a is a numeric value, zero is converted to false , otherwise it is converted to true.\n * If a is a quotation or a dictionary, the empty quotation or dictionary is converted to false , otherwise it is converted to true.\n * If a is a string, the empty string, and \"false\" are converted to false , otherwise it is converted to true.", + "description": "Converts a to a boolean value based on the following rules:\r\n \r\n * If a is a boolean value, no conversion is performed.\r\n * If a is null, it is converted to false .\r\n * If a is a numeric value, zero is converted to false , otherwise it is converted to true.\r\n * If a is a quotation or a dictionary, the empty quotation or dictionary is converted to false , otherwise it is converted to true.\r\n * If a is a string, the empty string, and \"false\" are converted to false , otherwise it is converted to true.", "kind": "symbol", "name": "bool", "signature": "a ==> bool"@@ -323,20 +318,14 @@ "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" + "signature": "'sym ==> str" }, "case": { - "description": "This operator takes a quotation containing _n_ different conditional branches. \n \n Each branch must be a quotation containing two quotations, and it is processed as follows:\n \n * if quot1 evaluates to true, then the quot2 is executed.\n * if quot1 evaluates to false , then the following branch is processed (if any).\n \n \n Example\n \n The following program prints \"Smaller than 3\":\n \n 2 (\n (( 3) (\"Greater than 3\" put!))\n ((< 3) (\"Smaller than 3\" put!))\n ((true) (\"Exactly 3\" put!))\n ) case", + "description": "This operator takes a quotation containing _n_ different conditional branches. \r\n \r\n Each branch must be a quotation containing two quotations, and it is processed as follows:\r\n \r\n * if quot1 evaluates to true, then the quot2 is executed.\r\n * if quot1 evaluates to false , then the following branch is processed (if any).\r\n \r\n \r\n Example\r\n \r\n The following program prints \"Smaller than 3\":\r\n \r\n 2 (\r\n (( 3) (\"Greater than 3\" put!))\r\n ((< 3) (\"Smaller than 3\" put!))\r\n ((true) (\"Exactly 3\" put!))\r\n ) case", "kind": "symbol", "name": "case", "signature": "((quot1 quot2)*) ==> a*"@@ -354,22 +343,22 @@ "name": "ceil",
"signature": "num ==> int" }, "chmod": { - "description": "Sets the permissions of file or directory 'sym to int. int is a three-digit representation of user, group and other permissions. See the [Unix Permissions Calculator](http://permissions-calculator.org/) for examples and conversions.\n \n \n Example\n \n The following program makes the file **/tmp/test.txt** readable, writable and executable by its owner, and readable and executable by users of the same group and all other users:\n \n /tmp/test.txt 755 chmod", + "description": "Sets the permissions of file or directory 'sym to int. int is a three-digit representation of user, group and other permissions. See the [Unix Permissions Calculator](http://permissions-calculator.org/) for examples and conversions.\r\n \r\n \r\n Example\r\n \r\n The following program makes the file **/tmp/test.txt** readable, writable and executable by its owner, and readable and executable by users of the same group and all other users:\r\n \r\n /tmp/test.txt 755 chmod", "kind": "symbol", "name": "chmod", "signature": "'sym int ==> " }, "choose": { - "description": "Prints 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.", + "description": "Prints str2, then prints all str1 included in the quotation prepended with a number, and waits from valid input from the user.\r\n \r\n If the user enters a number that matches one of the choices, then the corresponding quotation quot1 is executed, otherwise the choice menu is displayed again until a valid choice is made.", "kind": "symbol", "name": "choose", - "signature": "((string1 quot1)+) string2 ==> a*" + "signature": "((str1 quot1)+) str2 ==> a*" }, "chr": { - "description": "Returns the single character string obtained by interpreting int as an ASCII code.", + "description": "Returns the single character str obtained by interpreting int as an ASCII code.", "kind": "symbol", "name": "chr", - "signature": "int ==> string" + "signature": "int ==> str" }, "clear": { "description": "Clears the screen.",@@ -384,7 +373,7 @@ "name": "clear-stack",
"signature": "a ==> " }, "cleave": { - "description": "Applies each quotation contained in the first element to the second element a1.\n \n Example\n \n The following program leaves 2 on the stack:\n \n (1 2 3) ((sum) (size)) cleave /", + "description": "Applies each quotation contained in the first element to the second element a1.\r\n \r\n Example\r\n \r\n The following program leaves 2 on the stack:\r\n \r\n (1 2 3) ((sum) (size)) cleave /", "kind": "symbol", "name": "cleave", "signature": "a1 (quot*) ==> a*"@@ -414,16 +403,16 @@ "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.", + "description": "Prints str (prompt) appending \" [yes/no]: \", reads a line from STDIN and:\r\n \r\n * if it matches /^y(es)?$/i, puts true on the stack.\r\n * if it matches /^no?$/i, puts false on the stack. \r\n * Otherwise, it prints Invalid answer. Please enter 'yes' or 'no': and waits for a new answer.", "kind": "symbol", "name": "confirm", - "signature": "string ==> bool" + "signature": "str ==> 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", + "description": "Connects socket dict:socket to address str and port int.\r\n \r\n \r\n Example\r\n \r\n The following code shows how to send a message to a server running on localhost:7777. The message is passed as the first argument to the program.\r\n \r\n {} socket \"localhost\" 7777 connect =cli\r\n \r\n args 1 get :msg\r\n \r\n \"Sending message \\\"$1\\\" to localhost:7777...\" (msg) = send\r\n \r\n \"Done.\" puts!\r\n \r\n cli close", "kind": "symbol", "name": "connect", - "signature": "dict:socket string int ==> dict:socket" + "signature": "dict:socket str int ==> dict:socket" }, "cons": { "description": "Prepends a1 to the quotation on top of the stack.",@@ -453,13 +442,13 @@ "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" + "signature": " ==> str" }, "ctime": { "description": "Returns a timestamp corresponding to the time that file/directory 'sym was created.", "kind": "symbol", "name": "ctime", - "signature": "'sym ==> float" + "signature": "'sym ==> flt" }, "d2r": { "description": "Converts num1 from degrees to radians.",@@ -471,7 +460,7 @@ "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" + "signature": "int ==> str" }, "ddel": { "description": "Removes 'sym from dict1 and returns dict1.",@@ -495,7 +484,7 @@ "decode": {
"description": "Decodes the Base64-encoded string 'sym.", "kind": "symbol", "name": "decode", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "define": { "description": "Defines a new symbol 'sym, containing the specified value (auto-quoted if not already a quotation).",@@ -515,18 +504,12 @@ "kind": "symbol",
"name": "defined-sigil?", "signature": "'sym ==> bool" }, - "defined?": { + "defined-symbol?": { "description": "Returns true if the symbol 'sym is defined, false otherwise.", "kind": "symbol", - "name": "defined?", + "name": "defined-symbol?", "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",@@ -534,7 +517,7 @@ "name": "delete-sigil",
"signature": "'sym ==> " }, "dequote": { - "description": "Pushes the contents of quotation quot on the stack.\n\n Each element is pushed on the stack one by one. If any error occurs, quot is restored on the stack.", + "description": "Pushes the contents of quotation quot on the stack.\r\n\r\n Each element is pushed on the stack one by one. If any error occurs, quot is restored on the stack.", "kind": "symbol", "name": "dequote", "signature": "quot ==> a*"@@ -546,7 +529,7 @@ "name": "dget",
"signature": "dict 'sym ==> a" }, "dhas?": { - "description": "Returns true if dictionary dict contains the key 'sym, false otherwise.\n \n \n Example\n \n The following program returns true:\n \n {true :a1 \"aaa\" :a2 false :a3} 'a2 dhas?", + "description": "Returns true if dictionary dict contains the key 'sym, false otherwise.\r\n \r\n \r\n Example\r\n \r\n The following program returns true:\r\n \r\n {true :a1 \"aaa\" :a2 false :a3} 'a2 dhas?", "kind": "symbol", "name": "dhas?", "signature": "dict 'sym ==> bool"@@ -558,7 +541,7 @@ "name": "dictionary?",
"signature": "a ==> bool" }, "difference": { - "description": "Calculates the difference quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (2) on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) difference", + "description": "Calculates the difference quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (2) on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) difference", "kind": "symbol", "name": "difference", "signature": "quot1 quot2 ==> quot3"@@ -579,7 +562,7 @@ "dirname": {
"description": "Returns the path of the directory containing path 'sym.", "kind": "symbol", "name": "dirname", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "div": { "description": "Divides int1 by int2 (integer division).",@@ -591,13 +574,13 @@ "dkeys": {
"description": "Returns a quotation containing all the keys of dictionary dict.", "kind": "symbol", "name": "dkeys", - "signature": "dict ==> (string*)" + "signature": "dict ==> (str*)" }, "download": { - "description": "Downloads the contents of URL string1 to the local file string2.", + "description": "Downloads the contents of URL str1 to the local file str2.", "kind": "symbol", "name": "download", - "signature": "string1 string2 ==> " + "signature": "str1 str2 ==> " }, "dpairs": { "description": "Returns a quotation containing all the keys (odd items) and values (even items) of dictiionary dict.",@@ -606,7 +589,7 @@ "name": "dpairs",
"signature": "dict ==> (a*)" }, "dpick": { - "description": "Returns a new dictionary dict2 containing the elements of dict1 whose keys are included in quot.\n \n \n Example\n \n The following program returns {4 :a 7 :d}:\n \n {5 :q 4 :a 6 :c 7 :d \"d\" :a} (\"a\" \"d\") dpick", + "description": "Returns a new dictionary dict2 containing the elements of dict1 whose keys are included in quot.\r\n \r\n \r\n Example\r\n \r\n The following program returns {4 :a 7 :d}:\r\n \r\n {5 :q 4 :a 6 :c 7 :d \"d\" :a} (\"a\" \"d\") dpick", "kind": "symbol", "name": "dpick", "signature": "dict1 quot ==> dict2"@@ -654,7 +637,7 @@ "name": "dsput",
"signature": "dict:datastore 'sym dict ==> dict:datastore" }, "dsquery": { - "description": "Retrieves a quotation of dictionaries from the collection 'sym of datastore dict:datastore obtained by applying quot as a filter to each item of the collection, picking only the elements that match the filter.\n\n \n Example\n\n Assuming that **ds** is a datastore, the following program retrieves all elements of teh collection **posts** whose author field is set to \"h3rald\":\n\n ds \"posts\" (/author \"h3rald\" ==) dsquery", + "description": "Retrieves a quotation of dictionaries from the collection 'sym of datastore dict:datastore obtained by applying quot as a filter to each item of the collection, picking only the elements that match the filter.\r\n\r\n \r\n Example\r\n\r\n Assuming that **ds** is a datastore, the following program retrieves all elements of teh collection **posts** whose author field is set to \"h3rald\":\r\n\r\n ds \"posts\" (/author \"h3rald\" ==) dsquery", "kind": "symbol", "name": "dsquery", "signature": "dict:datastore 'sym quot ==> (dict*)"@@ -675,7 +658,7 @@ "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" + "signature": "dict ==> str" }, "dup": { "description": "Duplicates the first element on the stack.",@@ -699,7 +682,7 @@ "encode": {
"description": "Base64-encodes 'sym.", "kind": "symbol", "name": "encode", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "env?": { "description": "Returns true if environment variable 'sym exists, false otherwise.",@@ -717,13 +700,13 @@ "escape": {
"description": "Returns a copy of 'sym with quotes and backslashes escaped with a backslash.", "kind": "symbol", "name": "escape", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "eval": { - "description": "Parses and interprets string.", + "description": "Parses and interprets str.", "kind": "symbol", "name": "eval", - "signature": "string ==> a*" + "signature": "str ==> a*" }, "even?": { "description": "Returns true if int is even, false otherwise.",@@ -744,7 +727,7 @@ "name": "exit",
"signature": "int ==> " }, "expect": { - "description": "Validates the first _n_ elements of the stack against the type descriptions specified in quot1 (_n_ is quot1's length) and if all the elements are valid returns them wrapped in quot2 (in reverse order). \n\n \n Tips\n \n * You can specify a typed dictionary by prepending the type name with dict:. Example: dict:socket\n * You can specify two or more matching types by separating 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) ==", + "description": "Validates the first _n_ elements of the stack against the type descriptions specified in quot1 (_n_ is quot1's length) and if all the elements are valid returns them wrapped in quot2 (in reverse order). \r\n\r\n \r\n Tips\r\n \r\n * You can specify a typed dictionary by prepending the type name with dict:. Example: dict:socket\r\n * You can specify two or more matching types by separating the type names with a pipe: string|quot\r\n\r\n \r\n Example\r\n \r\n Assuming that the following elements are on the stack (from top to bottom): \r\n \r\n 1 \"test\" 3.4\r\n \r\n the following program evaluates to true:\r\n \r\n (int string num) expect (3.4 \"test\" 1) ==", "kind": "symbol", "name": "expect", "signature": "quot1 ==> quot2"@@ -768,10 +751,10 @@ "name": "expect-empty-stack",
"signature": " ==> " }, "fappend": { - "description": "Appends string1 to the end of file string2.", + "description": "Appends str1 to the end of file str2.", "kind": "symbol", "name": "fappend", - "signature": "string1 string2 ==> " + "signature": "str1 str2 ==> " }, "fatal": { "description": "Prints a and a new line to STDERR, and exists the program with error code 100.",@@ -789,16 +772,16 @@ "filename": {
"description": "Returns the file name of path 'sym.", "kind": "symbol", "name": "filename", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "filter": { - "description": "Returns a new quotation quot3 containing all elements of quot1 that satisfy predicate quot2.\n \n \n Example\n \n The following program leaves (2 6 8 12) on the stack:\n \n (1 37 34 2 6 8 12 21) \n (dup 20 < swap even? and) filter", + "description": "Returns a new quotation quot3 containing all elements of quot1 that satisfy predicate quot2.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (2 6 8 12) on the stack:\r\n \r\n (1 37 34 2 6 8 12 21) \r\n (dup 20 < swap even? and) filter", "kind": "symbol", "name": "filter", "signature": "quot1 quot2 ==> quot3" }, "find": { - "description": "Returns the index of the first element within quot1 that satisfies predicate quot2, or -1 if no element satisfies it.\n \n \n Example\n \n The following program leaves 3 on the stack:\n \n (1 2 4 8 16) \n (5 ) find", + "description": "Returns the index of the first element within quot1 that satisfies predicate quot2, or -1 if no element satisfies it.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 3 on the stack:\r\n \r\n (1 2 4 8 16) \r\n (5 ) find", "kind": "symbol", "name": "find", "signature": "quot1 quot2 ==> int"@@ -810,16 +793,16 @@ "name": "first",
"signature": "quot ==> a" }, "flatten": { - "description": "Flattens all quotations within quot1 and returns the resulting sequence quot2.\n \n \n Example\n \n The following program leaves (1 2 3 4 5 6 7 8) on the stack:\n \n (1 (2 3 4) 5 (6 7) 8) \n flatten", + "description": "Flattens all quotations within quot1 and returns the resulting sequence quot2.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 2 3 4 5 6 7 8) on the stack:\r\n \r\n (1 (2 3 4) 5 (6 7) 8) \r\n flatten", "kind": "symbol", "name": "flatten", "signature": "quot1 ==> quot2" }, "float": { - "description": "Converts a to 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.", + "description": "Converts a to an integer value based on the following rules:\r\n \r\n * If a is true, it is converted to 1.0.\r\n * If a is false , it is converted to 0.0.\r\n * If a is null, it is converted to 0.0\r\n. * If a is a integer, it is converted to float value.\r\n * If a is a float, no conversion is performed.\r\n * If a is a string, it is parsed as a float value.", "kind": "symbol", "name": "float", - "signature": "a ==> float" + "signature": "a ==> flt" }, "float?": { "description": "Returns true if a is a float, false otherwise.",@@ -840,10 +823,10 @@ "name": "foreach",
"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\"", + "description": "Formats the error dict:error as a string. \r\n \r\n Example\r\n \r\n The following code: \r\n \r\n (\r\n (\r\n {\"MyError\" :error \"This is a test error\" :message} raise\r\n ) \r\n (format-error)\r\n ) try\r\n \r\n produces: \"This is a test error\"", "kind": "symbol", "name": "format-error", - "signature": "dict:error ==> string" + "signature": "dict:error ==> str" }, "fperms": { "description": "Returns the Unix permissions (expressed as a three-digit number) of file/directory 'sym.",@@ -852,28 +835,28 @@ "name": "fperms",
"signature": "'sym ==> int" }, "fread": { - "description": "Reads the file string and puts its contents on the top of the stack as a string.", + "description": "Reads the file str and puts its contents on the top of the stack as a string.", "kind": "symbol", "name": "fread", - "signature": "string ==> string" + "signature": "str ==> str" }, "from-json": { "description": "Converts a JSON string into min data.", "kind": "symbol", "name": "from-json", - "signature": "string ==> a" + "signature": "str ==> 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.", + "description": "Given a basic [SemVer](https://semver.org)-compliant string (with no additional labels) str, \r\nit pushes a dictionary dict on the stack containing a **major**, **minor**, and **patch** key/value pairs.", "kind": "symbol", "name": "from-semver", - "signature": "string ==> dict" + "signature": "str ==> dict" }, "from-yaml": { - "description": "Converts a YAML string into min data.\n \n Note\n \n At present, only YAML objects containing string values are supported.", + "description": "Converts a YAML string into min data.\r\n \r\n Note\r\n \r\n At present, only YAML objects containing string values are supported.", "kind": "symbol", "name": "from-yaml", - "signature": "string ==> a" + "signature": "str ==> a" }, "fsize": { "description": "Returns the size in bytes of file/directory 'sym.",@@ -882,7 +865,7 @@ "name": "fsize",
"signature": "'sym ==> int" }, "fstats": { - "description": "Returns a dictionary dict containing information on file/directory 'sym.\n \n Example\n \n Assuming that min is a file, the following:\n \n \"min\" fstats\n \n produces:\n \n {\n \"min\" :name\n 16777220 :device\n 50112479 :file\n \"file\" :type\n 617068 :size\n 755 :permissions\n 1 :nlinks\n 1496583112.0 :ctime\n 1496584370.0 :atime\n 1496583112.0 :mtime\n }", + "description": "Returns a dictionary dict containing information on file/directory 'sym.\r\n \r\n Example\r\n \r\n Assuming that min is a file, the following:\r\n \r\n \"min\" fstats\r\n \r\n produces:\r\n \r\n {\r\n \"min\" :name\r\n 16777220 :device\r\n 50112479 :file\r\n \"file\" :type\r\n 617068 :size\r\n 755 :permissions\r\n 1 :nlinks\r\n 1496583112.0 :ctime\r\n 1496584370.0 :atime\r\n 1496583112.0 :mtime\r\n }", "kind": "symbol", "name": "fstats", "signature": "'sym ==> dict"@@ -891,13 +874,13 @@ "ftype": {
"description": "Returns the type of file/directory 'sym (\"file\" or \"dir\").", "kind": "symbol", "name": "ftype", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "fwrite": { - "description": "Writes string1 to the file string2, erasing all its contents first.", + "description": "Writes str1 to the file str2, erasing all its contents first.", "kind": "symbol", "name": "fwrite", - "signature": "string1 string2 ==> " + "signature": "str1 str2 ==> " }, "get": { "description": "Returns the _n^th_ element of quot (zero-based).",@@ -906,16 +889,16 @@ "name": "get",
"signature": "quot int ==> a" }, "get-content": { - "description": "Retrieves the contents of URL string1 as string2.", + "description": "Retrieves the contents of URL str1 as str2.", "kind": "symbol", "name": "get-content", - "signature": "string1 ==> string2" + "signature": "str1 ==> str2" }, "get-env": { "description": "Returns environment variable 'sym.", "kind": "symbol", "name": "get-env", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "get-stack": { "description": "Puts a quotation containing the contents of the stack on the stack.",@@ -933,7 +916,7 @@ "gets": {
"description": "Reads a line from STDIN and places it on top of the stack as a string.", "kind": "symbol", "name": "gets", - "signature": " ==> string" + "signature": " ==> str" }, "hardlink": { "description": "Creates hardlink 'sym2 for file or directory 'sym1.",@@ -942,7 +925,7 @@ "name": "hardlink",
"signature": "'sym1 'sym2 ==> " }, "harvest": { - "description": "Creates a new quotation quot2 containing all elements of quot1 except for empty quotations.\n \n \n Example\n \n The following program leaves (1 2 3) on the stack:\n \n (1 () () () 2 () 3) \n harvest", + "description": "Creates a new quotation quot2 containing all elements of quot1 except for empty quotations.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 2 3) on the stack:\r\n \r\n (1 () () () 2 () 3) \r\n harvest", "kind": "symbol", "name": "harvest", "signature": "quot1 ==> quot2"@@ -984,16 +967,16 @@ "name": "in?",
"signature": "quot a ==> bool" }, "indent": { - "description": "Returns string containing 'sym indented with int spaces.", + "description": "Returns str containing 'sym indented with int spaces.", "kind": "symbol", "name": "indent", - "signature": "'sym int ==> string" + "signature": "'sym int ==> str" }, "indexof": { - "description": "If string2 is contained in string1, returns the index of the first match or -1 if no match is found.", + "description": "If str2 is contained in str1, returns the index of the first match or -1 if no match is found.", "kind": "symbol", "name": "indexof", - "signature": "string1 string2 ==> int" + "signature": "str1 str2 ==> int" }, "inf": { "description": "Returns infinity.",@@ -1002,7 +985,7 @@ "name": "inf",
"signature": " ==> num" }, "infix-dequote": { - "description": "Dequotes quot using infix notation. \n \n Note that no special operator preference is defined, symbols precedence is always left-to-right. However, you can use parentheses (quotes) to evaluate expressions before others.\n \n \n Example\n \n The following program leaves 17 on the stack:\n\n (2 + (3 * 5)) infix-dequote\n\n while this program leaves 25 on the stack:\n \n (2 + 3 * 5) infix-dequote", + "description": "Dequotes quot using infix notation. \r\n \r\n Note that no special operator preference is defined, symbols precedence is always left-to-right. However, you can use parentheses (quotes) to evaluate expressions before others.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 17 on the stack:\r\n\r\n (2 + (3 * 5)) infix-dequote\r\n\r\n while this program leaves 25 on the stack:\r\n \r\n (2 + 3 * 5) infix-dequote", "kind": "symbol", "name": "infix-dequote", "signature": "quot ==> a"@@ -1020,7 +1003,7 @@ "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.", + "description": "Converts a to an integer value based on the following rules:\r\n \r\n * If a is true, it is converted to 1.\r\n * If a is false , it is converted to 0.\r\n * If a is null, it is converted to 0.\r\n * If a is an integer, no conversion is performed.\r\n * If a is a float, it is converted to an integer value by truncating its decimal part.\r\n * If a is a string, it is parsed as an integer value.", "kind": "symbol", "name": "int", "signature": "a ==> int"@@ -1032,25 +1015,25 @@ "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", + "description": "Calculates the intersection quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (1 \"test\") on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) intersection", "kind": "symbol", "name": "intersection", "signature": "quot1 quot2 ==> quot3" }, "invoke": { - "description": "Assming that 'sym is a formatted like *dictionary*/*symbol*, calls *symbol* defined in *dictionary* (note that this also works for nested dictionaries. \n \n \n Example\n \n The following program leaves 100 on the stack:\n \n {{100 :b} :a} :test *test/a/b", + "description": "Assming that 'sym is a formatted like *dictionary*/*symbol*, calls *symbol* defined in *dictionary* (note that this also works for nested dictionaries. \r\n \r\n \r\n Example\r\n \r\n The following program leaves 100 on the stack:\r\n \r\n {{100 :b} :a} :test *test/a/b", "kind": "symbol", "name": "invoke", "signature": "'sym ==> a*" }, "join": { - "description": "Joins the elements of quot using separator 'sym, producing string.", + "description": "Joins the elements of quot using separator 'sym, producing str.", "kind": "symbol", "name": "join", - "signature": "quot 'sym ==> string" + "signature": "quot 'sym ==> str" }, "keep": { - "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\n \n Example\n \n The following program leaves 5 3 on the stack:\n \n 2 3 '+ keep", + "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\r\n \r\n Example\r\n \r\n The following program leaves 5 3 on the stack:\r\n \r\n 2 3 '+ keep", "kind": "symbol", "name": "keep", "signature": "a1 quot ==> a* a1"@@ -1074,7 +1057,7 @@ "name": "line-info",
"signature": " ==> dict" }, "linrec": { - "description": "Implements linear recursions as follows:\n \n 1. Evaluates quot1.\n * If quot1 evaluates to true, then it evaluates quot2.\n * Otherwises it executes quot3 and recurses using the same four quotations.\n 2. Finally, it executes quot4.\n \n \n Example\n \n The following program leaves 120 on the stack, the factorial of 5:\n \n 5 (dup 0 ==) 'succ (dup pred) '* linrec", + "description": "Implements linear recursions as follows:\r\n \r\n 1. Evaluates quot1.\r\n * If quot1 evaluates to true, then it evaluates quot2.\r\n * Otherwises it executes quot3 and recurses using the same four quotations.\r\n 2. Finally, it executes quot4.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 120 on the stack, the factorial of 5:\r\n \r\n 5 (dup 0 ==) 'succ (dup pred) '* linrec", "kind": "symbol", "name": "linrec", "signature": "quot1 quot2 quot3 quot4 ==> a*"@@ -1116,7 +1099,7 @@ "name": "log2",
"signature": "num1 ==> num2" }, "loglevel": { - "description": "Sets the current logging level to 'sym. 'sym must be one of the following strings or quoted symbols:\n \n * debug\n * info\n * notice\n * warn\n * error\n * fatal\n \n \n Note\n \n The default logging level is _notice_.", + "description": "Sets the current logging level to 'sym. 'sym must be one of the following strings or quoted symbols:\r\n \r\n * debug\r\n * info\r\n * notice\r\n * warn\r\n * error\r\n * fatal\r\n \r\n \r\n Note\r\n \r\n The default logging level is _notice_.", "kind": "symbol", "name": "loglevel", "signature": "'sym ==> "@@ -1125,13 +1108,13 @@ "loglevel?": {
"description": "Returns the current log level (debug, info, notive, warn, error or fatal).", "kind": "symbol", "name": "loglevel?", - "signature": " ==> string" + "signature": " ==> str" }, "lowercase": { "description": "Returns a copy of 'sym converted to lowercase.", "kind": "symbol", "name": "lowercase", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "ls": { "description": "Returns a quotation quot containing all children (files and directories) of the directory 'sym.",@@ -1152,34 +1135,34 @@ "name": "map",
"signature": "quot1 quot2 ==> quot3" }, "map-reduce": { - "description": "Applies quot2 (map) to each element of quot1 and then applies quot3 (reduce) to each successive element of quot1. quot1 must have at least one element.\n \n \n Example\n \n The following program leaves 35 on the stack:\n \n (1 3 5) \n (dup *) (+) map-reduce", + "description": "Applies quot2 (map) to each element of quot1 and then applies quot3 (reduce) to each successive element of quot1. quot1 must have at least one element.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 35 on the stack:\r\n \r\n (1 3 5) \r\n (dup *) (+) map-reduce", "kind": "symbol", "name": "map-reduce", "signature": "quot1 quot2 quot3 ==> int" }, "mapkey": { - "description": "Maps the named key/key combination 'sym to the quotation quot, so that quot is executed when key 'sym is pressed. \n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * The quotation will be executed by a copy of the min interpreter created when the mapping was defined. In other words, quotations executed by key bindings will not affect the current stack.\n \n \n Example\n \n The following program:\n \n (clear) 'ctrl+l keymap\n \n causes the CTRL+L key to clear the screen.", + "description": "Maps the named key/key combination 'sym to the quotation quot, so that quot is executed when key 'sym is pressed. \r\n\r\n \r\n Notes\r\n\r\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\r\n * The quotation will be executed by a copy of the min interpreter created when the mapping was defined. In other words, quotations executed by key bindings will not affect the current stack.\r\n \r\n \r\n Example\r\n \r\n The following program:\r\n \r\n (clear) 'ctrl+l keymap\r\n \r\n causes the CTRL+L key to clear the screen.", "kind": "symbol", "name": "mapkey", "signature": "quot 'sym ==> " }, "match": { - "description": "Returns true if string2 matches string1, false otherwise.\n \n Tip\n \n string2 can be a sgregex-compatible regular expression.", + "description": "Returns true if str2 matches str1, false otherwise.\r\n \r\n Tip\r\n \r\n str2 can be a sgregex-compatible regular expression.", "kind": "symbol", "name": "match", - "signature": "string1 string2 ==> bool" + "signature": "str1 str2 ==> bool" }, "md4": { "description": "Returns the MD4 hash of 'sym.", "kind": "symbol", "name": "md4", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "md5": { "description": "Returns the MD5 hash of 'sym.", "kind": "symbol", "name": "md5", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "med": { "description": "Returns the median of the items of quot.",@@ -1199,17 +1182,11 @@ "kind": "symbol",
"name": "mod", "signature": "int1 int2 ==> int3" }, - "module": { - "description": "Creates a new module 'sym based on dictionary dict.", - "kind": "symbol", - "name": "module", - "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" + "signature": "'sym ==> flt" }, "mv": { "description": "Moves the file or directory 'sym1 to 'sym2.",@@ -1251,7 +1228,7 @@ "now": {
"description": "Returns the current time as Unix timestamp with microseconds.", "kind": "symbol", "name": "now", - "signature": " ==> float" + "signature": " ==> flt" }, "null?": { "description": "Returns true if a is null, false otherwise.",@@ -1278,7 +1255,7 @@ "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 ) ::", + "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.\r\n \r\n quot is a quotation containing:\r\n \r\n * A symbol identifying the type of operator to define (symbol or sigil).\r\n * A symbol identifying the name of the operator.\r\n * A quotation defining the signature of the operatorm containing input and output values identified by their type and a capturing symbol, separated by the == symbol.\r\n * A quotation identifying the body of the operator.\r\n\r\n The main additional features offered by this way of defining operators are the following:\r\n\r\n * Both input and output values are checked against a type (like when using the expect operator *and* automatically captured in a symbol that can be referenced in the operator body quotation.\r\n * The full signature of the operator is declared, making the resulting code easier to understand at quick glance.\r\n * An exception is automatically raised if the operator body pollutes the stack by adding or removing elementa from the stack (besides adding the declared output values).\r\n * It is possible to use the return symbol within the body quotation to immediately stop the evaluation of the body quotation and automatically push the output values on the stack.\r\n \r\n \r\n Example\r\n \r\n The following program defines a pow operator that calculates the power of a number providing its base and exponent, and handling some NaN results using the return symbol:\r\n\r\n (\r\n symbol pow\r\n (num :base int :exp == num :result)\r\n ( \r\n (base 0 == exp 0 == and)\r\n (nan @result return)\r\n when\r\n (base 1 == exp inf == and)\r\n (nan @result return)\r\n when\r\n (base inf == exp 0 == and)\r\n (nan @result return)\r\n when\r\n exp 1 - :n\r\n base (dup) n times (*) n times @result\r\n )\r\n ) ::", "kind": "symbol", "name": "operator", "signature": "quot ==> a*"@@ -1296,16 +1273,16 @@ "name": "or",
"signature": "bool1 bool2 ==> bool3" }, "ord": { - "description": "Returns the ASCII code int corresponding to the single character string.", + "description": "Returns the ASCII code int corresponding to the single character str.", "kind": "symbol", "name": "ord", - "signature": "string ==> int" + "signature": "str ==> int" }, "os": { "description": "Returns the host operating system. It can be one of the following strings: windows, macosx, linux, netbsd, freebsd, openbsd, solaris, aix, standalone.", "kind": "symbol", "name": "os", - "signature": " ==> string" + "signature": " ==> str" }, "over": { "description": "Pushes a copy of the second element on top of the stack.",@@ -1314,19 +1291,19 @@ "name": "over",
"signature": "a1 a2 ==> a1 a2 a1" }, "parse": { - "description": "Parses string and returns a quoted program quot.", + "description": "Parses str and returns a quoted program quot.", "kind": "symbol", "name": "parse", - "signature": "string ==> quot" + "signature": "str ==> quot" }, "parse-url": { - "description": "Parses the url string into its components and stores them into url.", + "description": "Parses the url str into its components and stores them into url.", "kind": "symbol", "name": "parse-url", - "signature": "string ==> url" + "signature": "str ==> url" }, "partition": { - "description": "Partitions quot1 into two quotations: quot3 contains all elements of quot1 that satisfy predicate quot2, quot4 all the others.\n \n \n Example\n \n The following program leaves (1 3 5) (2 4 6) on the stack:\n \n (1 2 3 4 5 6) \n (odd?) partition", + "description": "Partitions quot1 into two quotations: quot3 contains all elements of quot1 that satisfy predicate quot2, quot4 all the others.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 3 5) (2 4 6) on the stack:\r\n \r\n (1 2 3 4 5 6) \r\n (odd?) partition", "kind": "symbol", "name": "partition", "signature": "quot1 quot2 ==> quot3 quot4"@@ -1335,7 +1312,7 @@ "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" + "signature": " ==> str" }, "pi": { "description": "Returns the value of the π constant.",@@ -1371,10 +1348,10 @@ "prefix": {
"description": "Prepends 'sym2 to 'sym1.", "kind": "symbol", "name": "prefix", - "signature": "'sym1 'sym2 ==> string" + "signature": "'sym1 'sym2 ==> str" }, "prefix-dequote": { - "description": "Dequotes quot using prefix notation (essentially it reverses quot and dequotes it).\n \n \n Example\n \n The following program leaves 4 on the stack:\n\n (* 8 4) prefix-dequote", + "description": "Dequotes quot using prefix notation (essentially it reverses quot and dequotes it).\r\n \r\n \r\n Example\r\n \r\n The following program leaves 4 on the stack:\r\n\r\n (* 8 4) prefix-dequote", "kind": "symbol", "name": "prefix-dequote", "signature": "quot ==> a"@@ -1398,13 +1375,13 @@ "name": "product",
"signature": "quot ==> int" }, "prompt": { - "description": "This symbol is used to configure the prompt of the min shell. By default, it is set to the following quotation:\n \n (\"[$1]$$ \" (.) = %)\n \n Unlike other predefined symbols, this symbol is _unsealed_, which means it can be modified.", + "description": "This symbol is used to configure the prompt of the min shell. By default, it is set to the following quotation:\r\n \r\n (\"[$1]$$ \" (.) = %)\r\n \r\n Unlike other predefined symbols, this symbol is _unsealed_, which means it can be modified.", "kind": "symbol", "name": "prompt", - "signature": " ==> string" + "signature": " ==> str" }, "publish": { - "description": "Publishes symbol 'sym to the scope of dict.\n \n \n Example\n \n Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope:\n 'my-local-symbol ROOT publish", + "description": "Publishes symbol 'sym to the scope of dict.\r\n \r\n \r\n Example\r\n \r\n Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope:\r\n 'my-local-symbol ROOT publish", "kind": "symbol", "name": "publish", "signature": "'sym dict ==> "@@ -1413,13 +1390,13 @@ "put-env": {
"description": "Sets environment variable 'sym2 to 'sym1.", "kind": "symbol", "name": "put-env", - "signature": "'sym1 'sym2 ==> string" + "signature": "'sym1 'sym2 ==> str" }, "putchr": { - "description": "Prints string to STDOUT without printing a new line (string must contain only one character).", + "description": "Prints str to STDOUT without printing a new line (str must contain only one character).", "kind": "symbol", "name": "putchr", - "signature": "string ==> a" + "signature": "str ==> a" }, "puts": { "description": "Prints a and a new line to STDOUT.",@@ -1476,7 +1453,7 @@ "name": "raise",
"signature": "dict:error ==> " }, "random": { - "description": "Returns a random number int2 between 0 and int1-1. \n \n \n Note\n \n You must call randomize to initialize the random number generator, otherwise the same sequence of numbers will be returned.", + "description": "Returns a random number int2 between 0 and int1-1. \r\n \r\n \r\n Note\r\n \r\n You must call randomize to initialize the random number generator, otherwise the same sequence of numbers will be returned.", "kind": "symbol", "name": "random", "signature": "int1 ==> int2"@@ -1500,28 +1477,28 @@ "name": "raw-args",
"signature": " ==> quot" }, "recv": { - "description": "Waits to receive int characters from dict:socket and returns the resulting data string.", + "description": "Waits to receive int characters from dict:socket and returns the resulting data str.", "kind": "symbol", "name": "recv", - "signature": "dict:socket int ==> string" + "signature": "dict:socket int ==> str" }, "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", + "description": "Waits to receive a line of data from dict:socket and returns the resulting data str. \"\" is returned if dict:socket is disconnected.\r\n \r\n \r\n Example\r\n \r\n The following code shows how to make a simple GET request to <http://httpbin.org/uuid to receive a random UUID and display its response:\r\n \r\n \r\n {} socket \"httpbin.org\" 80 connect =cli\r\n \r\n cli \"GET /uuid HTTP/1.1\\r\\nHost: httpbin.org\\r\\n\\r\\n\" send\r\n \r\n cli recv-line puts :line\r\n (line \"\\}\" match not) \r\n (\r\n cli recv-line puts @line\r\n ) while", "kind": "symbol", "name": "recv-line", - "signature": "dict:socket ==> string" + "signature": "dict:socket ==> str" }, "reduce": { - "description": "Combines each successive element of quot1 using quot2. On the first iteration, the first two inputs processed by quot2 are a and the first element of quot1.\n \n \n Example\n \n The following program leaves 120 on the stack:\n \n (1 2 3 4 5) \n 1 (*) reduce", + "description": "Combines each successive element of quot1 using quot2. On the first iteration, the first two inputs processed by quot2 are a and the first element of quot1.\r\n \r\n \r\n Example\r\n \r\n The following program leaves 120 on the stack:\r\n \r\n (1 2 3 4 5) \r\n 1 (*) reduce", "kind": "symbol", "name": "reduce", "signature": "quot1 a quot2 ==> int" }, "regex": { - "description": "Performs a search and/or a search-and-replace operation using pattern 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\")", + "description": "Performs a search and/or a search-and-replace operation using pattern str2.\r\n \r\n str2 can be one of the following patterns:\r\n \r\n * **/**_search-regex_**/**_modifiers_\r\n * **s/**_search-regex_**/**_replacemenet_**/**_modifiers_\r\n \r\n quot is always a quotation containing:\r\n \r\n * One or more strings containing the first match and captures (if any), like for the search operator.\r\n * A string containing the resuling string after the search-and-replace operation.\r\n \r\n \r\n Tip\r\n \r\n * _search-regex_ can be a sgregex-compatible regular expression.\r\n * _modifiers_ are optionals can contain one or more of the following characters, in any order:\r\n * **i**: case-insensitive match.\r\n * **m**: multi-line match.\r\n * **s**: dot character includes newlines.\r\n \r\n \r\n Example: Search\r\n \r\n The following:\r\n \r\n \"This is a GOOD idea.\" \"/(good) idea/i\" regex\r\n \r\n produces: (\"GOOD idea\", \"GOOD\")\r\n \r\n \r\n Example: Search and Replace\r\n \r\n The following:\r\n \r\n \"This is a GOOD idea.\" \"s/good/bad/i\" regex\r\n \r\n produces: (\"This is a bad idea\")", "kind": "symbol", "name": "regex", - "signature": "string1 string2 ==> quot" + "signature": "str1 str2 ==> quot" }, "reject": { "description": "Returns a new quotatios quot3 including all elements of quot1 that do not satisfy predicate quot2 (i.e. the opposite of filter)",@@ -1542,19 +1519,19 @@ "name": "remove-symbol",
"signature": "'sym ==> " }, "repeat": { - "description": "Returns string containing 'sym repeated int times.", + "description": "Returns str containing 'sym repeated int times.", "kind": "symbol", "name": "repeat", - "signature": "'sym int ==> string" + "signature": "'sym int ==> str" }, "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?\"", + "description": "Returns a copy of str1 containing all occurrences of str2 replaced by str3\r\n \r\n Tip\r\n \r\n str2 can be a sgregex-compatible regular expression.\r\n \r\n \r\n Example\r\n \r\n The following:\r\n \r\n \"This is a stupid test. Is it really a stupid test?\" \" s[a-z]+\" \" simple\" replace\r\n \r\n produces:\r\n \r\n \"This is a simple test. Is it really a simple test?\"", "kind": "symbol", "name": "replace", - "signature": "string1 string2 string3 ==> string4" + "signature": "str1 str2 str3 ==> str4" }, "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", + "description": "Performs an HTTP request.\r\n \r\n \r\n Example\r\n \r\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:\r\n \r\n {}\r\n \"GET\" url\r\n request", "kind": "symbol", "name": "request", "signature": "request ==> response"@@ -1572,7 +1549,7 @@ "name": "rest",
"signature": "quot1 ==> quot2" }, "return": { - "description": "If used within the body quotation of an operator definition, causes the interpreter to stop pushing further body elements on the stack and start pushing tbe operator output values on the stack. \n\nIf used outside of the body quotation of an operator definition, it raises an exception.", + "description": "If used within the body quotation of an operator definition, causes the interpreter to stop pushing further body elements on the stack and start pushing tbe operator output values on the stack. \r\n\r\nIf used outside of the body quotation of an operator definition, it raises an exception.", "kind": "symbol", "name": "return", "signature": " ==> "@@ -1629,10 +1606,10 @@ "saved-symbols": {
"description": "Returns a quotation containing all symbols saved in the [.min\\_symbols](class:file) file.", "kind": "symbol", "name": "saved-symbols", - "signature": " ==> (string*)" + "signature": " ==> (str*)" }, "scope": { - "description": "Returns a dictionary dict holding a reference to the current scope.\n \n This can be useful to save a reference to a given execution scope to access later on.\n\n \n Example\n \n The following program leaves {(2) :two ;module} on the stack:\n \n {} :myscope (2 :two scope @myscope) -", + "description": "Returns a dictionary dict holding a reference to the current scope.\r\n \r\n This can be useful to save a reference to a given execution scope to access later on.\r\n\r\n \r\n Example\r\n \r\n The following program leaves {(2) :two ;module} on the stack:\r\n \r\n {} :myscope (2 :two scope @myscope) -", "kind": "symbol", "name": "scope", "signature": " ==> dict"@@ -1641,24 +1618,24 @@ "scope-sigils": {
"description": "Returns a list of all sigils defined in dictionary dict.", "kind": "symbol", "name": "scope-sigils", - "signature": "dict ==> (string*)" + "signature": "dict ==> (str*)" }, "scope-symbols": { "description": "Returns a list of all symbols defined in dictionary dict.", "kind": "symbol", "name": "scope-symbols", - "signature": "dict ==> (string*)" + "signature": "dict ==> (str*)" }, - "seal": { - "description": "Seals symbol 'sym, so that it cannot be re-assigned.", + "seal-sigil": { + "description": "Seals the user-defined sigil 'sym, so that it cannot be re-defined.", "kind": "symbol", - "name": "seal", + "name": "seal-sigil", "signature": "'sym ==> " }, - "seal-sigil": { - "description": "Seals the user-defined sigil 'sym, so that it cannot be re-defined.", + "seal-symbol": { + "description": "Seals symbol 'sym, so that it cannot be re-assigned.", "kind": "symbol", - "name": "seal-sigil", + "name": "seal-symbol", "signature": "'sym ==> " }, "sealed-sigil?": {@@ -1667,53 +1644,53 @@ "kind": "symbol",
"name": "sealed-sigil?", "signature": "'sym ==> bool" }, - "sealed?": { + "sealed-symbol?": { "description": "Returns true if the symbol 'sym is sealed, false otherwise.", "kind": "symbol", - "name": "sealed?", + "name": "sealed-symbol?", "signature": "'sym ==> bool" }, "search": { - "description": "Returns a quotation containing the first occurrence of string2 within string1. Note that:\n \n * The first element of quot is the matching substring.\n * Other elements (if any) contain captured substrings.\n \n \n Tip\n \n string2 can be a sgregex-compatible regular expression.\n \n \n Example\n \n The following:\n \n \"192.168.1.1, 127.0.0.1\" \"[0-9]+\\.[0-9]+\\.([0-9]+)\\.([0-9]+)\" search\n \n produces: (\"192.168.1.1\", \"1\", \"1\")", + "description": "Returns a quotation containing the first occurrence of str2 within str1. Note that:\r\n \r\n * The first element of quot is the matching substring.\r\n * Other elements (if any) contain captured substrings.\r\n \r\n \r\n Tip\r\n \r\n str2 can be a sgregex-compatible regular expression.\r\n \r\n \r\n Example\r\n \r\n The following:\r\n \r\n \"192.168.1.1, 127.0.0.1\" \"[0-9]+\\.[0-9]+\\.([0-9]+)\\.([0-9]+)\" search\r\n \r\n produces: (\"192.168.1.1\", \"1\", \"1\")", "kind": "symbol", "name": "search", - "signature": "string1 string2 ==> quot" + "signature": "str1 str2 ==> quot" }, "search-all": { - "description": "Returns a quotation of quotations (like the one returned by the search operator) containing all occurrences of string2 within string1.", + "description": "Returns a quotation of quotations (like the one returned by the search operator) containing all occurrences of str2 within str1.", "kind": "symbol", "name": "search-all", - "signature": "string1 string2 ==> quot" + "signature": "str1 str2 ==> quot" }, "semver-inc-major": { - "description": "Increments the major digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", + "description": "Increments the major digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) str1.", "kind": "symbol", "name": "semver-inc-major", - "signature": "string1 ==> string2" + "signature": "str1 ==> str2" }, "semver-inc-minor": { - "description": "Increments the minor digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", + "description": "Increments the minor digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) str1.", "kind": "symbol", "name": "semver-inc-minor", - "signature": "string1 ==> string2" + "signature": "str1 ==> str2" }, "semver-inc-patch": { - "description": "Increments the patch digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) string1.", + "description": "Increments the patch digit of the [SemVer](https://semver.org)-compliant string (with no additional labels) str1.", "kind": "symbol", "name": "semver-inc-patch", - "signature": "string1 ==> string2" + "signature": "str1 ==> str2" }, "semver?": { - "description": "Checks whether string is a [SemVer](https://semver.org)-compliant version or not.", + "description": "Checks whether str is a [SemVer](https://semver.org)-compliant version or not.", "kind": "symbol", "name": "semver?", - "signature": "string ==> bool" + "signature": "str ==> bool" }, "send": { - "description": "Sends string to the connected socket dict:socket.", + "description": "Sends str to the connected socket dict:socket.", "kind": "symbol", "name": "send", - "signature": "dict:socket string ==> " + "signature": "dict:socket str ==> " }, "set": { "description": "Sets the value of the _n^th_ element quot1 (zero-based) to a, and returns the modified copy of the quotation quot2.",@@ -1727,41 +1704,35 @@ "kind": "symbol",
"name": "set-stack", "signature": "quot ==> a*" }, - "set-type": { - "description": "Sets the type for dictionary dict to 'sym.", - "kind": "symbol", - "name": "set-type", - "signature": "dict 'sym ==> dict" - }, "sha1": { "description": "Returns the SHA1 hash of 'sym.", "kind": "symbol", "name": "sha1", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "sha224": { "description": "Returns the SHA224 hash of 'sym.", "kind": "symbol", "name": "sha224", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "sha256": { "description": "Returns the SHA256 hash of 'sym.", "kind": "symbol", "name": "sha256", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "sha384": { "description": "Returns the SHA384 hash of 'sym.", "kind": "symbol", "name": "sha384", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "sha512": { "description": "Returns the SHA512 hash of 'sym.", "kind": "symbol", "name": "sha512", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "shl": { "description": "Computes the *shift left* operation of int1 and int2.",@@ -1785,7 +1756,7 @@ "sigils": {
"description": "Returns a list of all sigils defined in the [ROOT](class:kwd) scope.", "kind": "symbol", "name": "sigils", - "signature": " ==> (string*)" + "signature": " ==> (str*)" }, "sin": { "description": "Calculates the sine of num1 (in radians).",@@ -1818,19 +1789,19 @@ "name": "sleep",
"signature": "int ==> " }, "slice": { - "description": "Creates a new quotation quot2 obtaining by selecting all elements of quot1 between indexes int1 and int2.\n \n \n Example\n \n The following program leaves (3 4 5) on the stack:\n \n (1 2 3 4 5 6) \n 2 4 slice", + "description": "Creates a new quotation quot2 obtaining by selecting all elements of quot1 between indexes int1 and int2.\r\n \r\n \r\n Example\r\n \r\n The following program leaves (3 4 5) on the stack:\r\n \r\n (1 2 3 4 5 6) \r\n 2 4 slice", "kind": "symbol", "name": "slice", "signature": "quot1 int1 int2 ==> quot2" }, "socket": { - "description": "Opens a new socket.\n \n dict can be empty or contain any of the following properties, used to specify the domain, type and protocol of the socket respectively.\n \n domain\n : The socket domain. It can be set to one of the following values:\n \n * **ipv4** (default): Internet Protocol version 4.\n * **ipv6**: Internet Protocol version 6.\n * **unix**: local Unix file (not supported on Windows systems).\n type\n : The socket type. It can be set to one of the following values:\n \n * **stream** (default): Reliable stream-oriented service or Stream Socket.\n * **dgram**: Datagram service or Datagram Socket.\n * **raw**: Raw protocols atop the network layer.\n * **seqpacket**: Reliable sequenced packet service.\n protocol\n : The socket protocol. It can be set to one of the following values:\n \n * **tcp** (default): Transmission Control Protocol.\n * **udp**: User Datagram Protocol.\n * **ipv4**: Internet Protocol version 4 (not supported on Windows systems).\n * **ipv6**: Internet Protocol version 6 (not supported on Windows systems).\n * **raw**: Raw IP Packets protocol (not supported on Windows systems).\n * **icmp**: Internet Control Message Protocol (not supported on Windows systems).", + "description": "Opens a new socket.\r\n \r\n dict can be empty or contain any of the following properties, used to specify the domain, type and protocol of the socket respectively.\r\n \r\n domain\r\n : The socket domain. It can be set to one of the following values:\r\n \r\n * **ipv4** (default): Internet Protocol version 4.\r\n * **ipv6**: Internet Protocol version 6.\r\n * **unix**: local Unix file (not supported on Windows systems).\r\n type\r\n : The socket type. It can be set to one of the following values:\r\n \r\n * **stream** (default): Reliable stream-oriented service or Stream Socket.\r\n * **dgram**: Datagram service or Datagram Socket.\r\n * **raw**: Raw protocols atop the network layer.\r\n * **seqpacket**: Reliable sequenced packet service.\r\n protocol\r\n : The socket protocol. It can be set to one of the following values:\r\n \r\n * **tcp** (default): Transmission Control Protocol.\r\n * **udp**: User Datagram Protocol.\r\n * **ipv4**: Internet Protocol version 4 (not supported on Windows systems).\r\n * **ipv6**: Internet Protocol version 6 (not supported on Windows systems).\r\n * **raw**: Raw IP Packets protocol (not supported on Windows systems).\r\n * **icmp**: Internet Control Message Protocol (not supported on Windows systems).", "kind": "symbol", "name": "socket", "signature": "dict ==> dict:socket" }, "sort": { - "description": "Sorts all elements of quot1 according to predicate quot2. \n \n \n Example\n \n The following program leaves (1 3 5 7 9 13 16) on the stack:\n \n (1 9 5 13 16 3 7) ' sort", + "description": "Sorts all elements of quot1 according to predicate quot2. \r\n \r\n \r\n Example\r\n \r\n The following program leaves (1 3 5 7 9 13 16) on the stack:\r\n \r\n (1 9 5 13 16 3 7) ' sort", "kind": "symbol", "name": "sort", "signature": "quot1 quot2 ==> quot3"@@ -1848,7 +1819,7 @@ "name": "split",
"signature": "'sym1 'sym2 ==> quot" }, "spread": { - "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\n \n Example\n \n The following program leaves (1 4) on the stack:\n \n (1 2) (3 4) ((0 get) (1 get)) spread", + "description": "Applies each quotation contained in the first element to each subsequent corresponding element.\r\n \r\n Example\r\n \r\n The following program leaves (1 4) on the stack:\r\n \r\n (1 2) (3 4) ((0 get) (1 get)) spread", "kind": "symbol", "name": "spread", "signature": "a* (quot*) ==> a*"@@ -1860,7 +1831,7 @@ "name": "sqrt",
"signature": "num1 ==> num2" }, "start-server": { - "description": "Starts an HTTP server based on the configuration provided in dict.\n \n dict is a dictionary containing the following keys:\n \n address\n : The address to bind the server to (default: **127.0.0.1**).\n port\n : The port to bind the server to.\n handler\n : A quotation with the following signature, used to handle all incoming requests: [request ⇒ response](class:kwd)\n \n \n Example\n \n The following program starts a very simple HTTP server that can display the current timestamp or date and time in ISO 8601 format:\n \n ; Define the request handler\n (\n ; Assume there is a request on the stack, take it off and give it the name req\n :req\n ; Let's see what we got (print req to standard out)\n \"THE REQUEST:\" puts! req puts!\n ; The request is a dictionary, we retrieve the value for the key url, and give it the name url\n req /url :url\n \"THE URL is '$1'.\" url quote ))\n ) case\n :body\n ; Prepare the response\n {} body handler\n 5555 %port\n \n ; Start server\n \"Server started on port 5555.\" puts!\n \"Press Ctrl+C to stop.\" puts!\n start-server", + "description": "Starts an HTTP server based on the configuration provided in dict.\r\n \r\n dict is a dictionary containing the following keys:\r\n \r\n address\r\n : The address to bind the server to (default: **127.0.0.1**).\r\n port\r\n : The port to bind the server to.\r\n handler\r\n : A quotation with the following signature, used to handle all incoming requests: [request ⇒ response](class:kwd)\r\n \r\n \r\n Example\r\n \r\n The following program starts a very simple HTTP server that can display the current timestamp or date and time in ISO 8601 format:\r\n \r\n ; Define the request handler\r\n (\r\n ; Assume there is a request on the stack, take it off and give it the name req\r\n :req\r\n ; Let's see what we got (print req to standard out)\r\n \"THE REQUEST:\" puts! req puts!\r\n ; The request is a dictionary, we retrieve the value for the key url, and give it the name url\r\n req /url :url\r\n \"THE URL is '$1'.\" url quote ))\r\n ) case\r\n :body\r\n ; Prepare the response\r\n {} body handler\r\n 5555 %port\r\n \r\n ; Start server\r\n \"Server started on port 5555.\" puts!\r\n \"Press Ctrl+C to stop.\" puts!\r\n start-server", "kind": "symbol", "name": "start-server", "signature": "dict ==> "@@ -1875,7 +1846,7 @@ "string": {
"description": "Converts a to its string representation.", "kind": "symbol", "name": "string", - "signature": "a ==> string" + "signature": "a ==> str" }, "string?": { "description": "Returns true if a is a string, false otherwise.",@@ -1890,16 +1861,16 @@ "name": "stringlike?",
"signature": "a ==> bool" }, "strip": { - "description": "Returns string, which is set to 'sym with leading and trailing spaces removed.", + "description": "Returns str, which is set to 'sym with leading and trailing spaces removed.", "kind": "symbol", "name": "strip", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "substr": { - "description": "Returns a substring string2 obtained by retriving int2 characters starting from index int1 within string1.", + "description": "Returns a substring str2 obtained by retriving int2 characters starting from index int1 within str1.", "kind": "symbol", "name": "substr", - "signature": "string1 int1 int2 ==> string2" + "signature": "str1 int1 int2 ==> str2" }, "succ": { "description": "Returns the successor of int1.",@@ -1911,7 +1882,7 @@ "suffix": {
"description": "Appends 'sym2 to 'sym1.", "kind": "symbol", "name": "suffix", - "signature": "'sym1 'sym2 ==> string" + "signature": "'sym1 'sym2 ==> str" }, "sum": { "description": "Returns the sum of all items of quot. quot is a quotation of integers.",@@ -1935,7 +1906,7 @@ "symbols": {
"description": "Returns a list of all symbols defined in the [ROOT](class:kwd) scope.", "kind": "symbol", "name": "symbols", - "signature": " ==> (string*)" + "signature": " ==> (str*)" }, "symlink": { "description": "Creates symlink 'sym2 for file or directory 'sym1.",@@ -1950,7 +1921,7 @@ "name": "symlink?",
"signature": "'sym ==> bool" }, "symmetric-difference": { - "description": "Calculates the symmetric difference quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (true \"a\" 2) on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) symmetric-difference", + "description": "Calculates the symmetric difference quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (true \"a\" 2) on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) symmetric-difference", "kind": "symbol", "name": "symmetric-difference", "signature": "quot1 quot2 ==> quot3"@@ -1980,7 +1951,7 @@ "name": "tanh",
"signature": "num1 ==> num2" }, "tap": { - "description": "Performs the following operations:\n \n 1. Removes a from the stack.\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\n 1. Pushes a back to the stack.\n 2. Dequotes the quotation and saves the result as a.\n 3. Push the resulting a back on the stack.\n \n \n Example\n \n The following program:\n \n {1 :a 2 :b 3 :c} (\n (dup /a succ succ b)\n ) tap\n \n Returns {3 :a 3 :b 3 :c}.", + "description": "Performs the following operations:\r\n \r\n 1. Removes a from the stack.\r\n 2. For each quotation defined in quot (which is a quotation of quotations each requiring one argument and returning one argument):\r\n 1. Pushes a back to the stack.\r\n 2. Dequotes the quotation and saves the result as a.\r\n 3. Push the resulting a back on the stack.\r\n \r\n \r\n Example\r\n \r\n The following program:\r\n \r\n {1 :a 2 :b 3 :c} (\r\n (dup /a succ succ b)\r\n ) tap\r\n \r\n Returns {3 :a 3 :b 3 :c}.", "kind": "symbol", "name": "tap", "signature": "a quot ==> a"@@ -2013,19 +1984,19 @@ "titleize": {
"description": "Returns a copy of 'sym in which the first character of each word is capitalized.", "kind": "symbol", "name": "titleize", - "signature": "'sym ==> string" + "signature": "'sym ==> str" }, "to-json": { "description": "Converts a into a JSON string.", "kind": "symbol", "name": "to-json", - "signature": "a ==> string" + "signature": "a ==> str" }, "to-semver": { - "description": "Given a a dictionary dict containing a **major**, **minor**, and **patch** key/value pairs , it pushes a basic [SemVer](https://semver.org)-compliant string (with no additional labels) string on the stack.", + "description": "Given a a dictionary dict containing a **major**, **minor**, and **patch** key/value pairs , it pushes a basic [SemVer](https://semver.org)-compliant string (with no additional labels) str on the stack.", "kind": "symbol", "name": "to-semver", - "signature": "dict ==> string" + "signature": "dict ==> str" }, "to-timestamp": { "description": "Converts the timeinfo dictionary dict:timeinfo to the corresponding Unix timestamp.",@@ -2034,10 +2005,10 @@ "name": "to-timestamp",
"signature": "dict:timeinfo ==> int" }, "to-yaml": { - "description": "Converts a into a YAML string.\n\n \n Note\n \n At present, only min dictionaries containing string values are supported.", + "description": "Converts a into a YAML string.\r\n\r\n \r\n Note\r\n \r\n At present, only min dictionaries containing string values are supported.", "kind": "symbol", "name": "to-yaml", - "signature": "a ==> string" + "signature": "a ==> str" }, "trunc": { "description": "Truncates num to the decimal point.",@@ -2046,7 +2017,7 @@ "name": "trunc",
"signature": "num1 ==> num2" }, "try": { - "description": "Evaluates a quotation as a try/catch/finally block. \n \n The must contain the following elements:\n \n 1. A quotation quot1 containing the code to be evaluated (_try_ block).\n 1. _(optional)_ A quotation quot2 containing the code to execute in case of error (_catch_ block).\n 1. _(optional)_ A quotation quot3 containing the code to execute after the code has been evaluated, whether an error occurred or not (_finally_ block).\n \n \n Example\n \n The following program executed on an empty stack prints the message \"Insufficient items on the stack\" and pushes 0 on the stack:\n \n (\n (pop)\n (format-error puts)\n (0)\n ) try", + "description": "Evaluates a quotation as a try/catch/finally block. \r\n \r\n The must contain the following elements:\r\n \r\n 1. A quotation quot1 containing the code to be evaluated (_try_ block).\r\n 1. _(optional)_ A quotation quot2 containing the code to execute in case of error (_catch_ block).\r\n 1. _(optional)_ A quotation quot3 containing the code to execute after the code has been evaluated, whether an error occurred or not (_finally_ block).\r\n \r\n \r\n Example\r\n \r\n The following program executed on an empty stack prints the message \"Insufficient items on the stack\" and pushes 0 on the stack:\r\n \r\n (\r\n (pop)\r\n (format-error puts)\r\n (0)\r\n ) try", "kind": "symbol", "name": "try", "signature": "(quot1 quot2? quot3?) ==> a*"@@ -2055,7 +2026,7 @@ "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" + "signature": "a ==> str" }, "type?": { "description": "Returns true if the data type of a is the specified type 'sym, false otherwise.",@@ -2064,13 +2035,13 @@ "name": "type?",
"signature": "a 'sym ==> bool" }, "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 ) ::", + "description": "Defines a new type class 'sym set to quotation quot, which can be used in operator signatures.\r\n \r\n \r\n Example\r\n \r\n Consider the following type class which defines a natural number: \r\n\r\n (:n ((n integer?) (n 0 )) &&) 'natural typeclass\r\n \r\n It can now be used in operator signatures, like this:\r\n \r\n (\r\n symbol natural-sum\r\n (natural :n natural :m == natural :result)\r\n (n m + @result)\r\n ) ::", "kind": "symbol", "name": "typeclass", "signature": "quot 'sym ==> " }, "union": { - "description": "Calculates the union quot3 of quot1 and quot2.\n\n \n Example\n \n The following program leaves (true 1 \"test\" \"a\" 2) on the stack:\n \n (1 2 \"test\") (\"test\" \"a\" true 1) union", + "description": "Calculates the union quot3 of quot1 and quot2.\r\n\r\n \r\n Example\r\n \r\n The following program leaves (true 1 \"test\" \"a\" 2) on the stack:\r\n \r\n (1 2 \"test\") (\"test\" \"a\" true 1) union", "kind": "symbol", "name": "union", "signature": "quot1 quot2 ==> quot3"@@ -2082,23 +2053,23 @@ "name": "unless",
"signature": "quot1 quot2 ==> a*" }, "unmapkey": { - "description": "Unmaps a previously-mapped key or key-combination 'sym, restoring the default mapping if available.\n\n \n Notes\n\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\n * At present, all the default mappings of min are those provided by the [nimline](https://h3rald.com/nimline/nimline.html) library.", + "description": "Unmaps a previously-mapped key or key-combination 'sym, restoring the default mapping if available.\r\n\r\n \r\n Notes\r\n\r\n * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported.\r\n * At present, all the default mappings of min are those provided by the [nimline](https://h3rald.com/nimline/nimline.html) library.", "kind": "symbol", "name": "unmapkey", "signature": "'sym ==> " }, - "unseal": { - "description": "Unseals the user-defined symbol 'sym, so that it can be re-assigned.", - "kind": "symbol", - "name": "unseal", - "signature": "'sym ==> " - }, "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 ==> " }, + "unseal-symbol": { + "description": "Unseals the user-defined symbol 'sym, so that it can be re-assigned.", + "kind": "symbol", + "name": "unseal-symbol", + "signature": "'sym ==> " + }, "unzip": { "description": "Decompresses zip file 'sym1 to directory 'sym2 (created if not present).", "kind": "symbol",@@ -2115,7 +2086,7 @@ "version": {
"description": "Returns the current min version number.", "kind": "symbol", "name": "version", - "signature": " ==> string" + "signature": " ==> str" }, "warning": { "description": "Prints a and a new line to STDERR, if logging level is set to [warning](class:kwd) or lower.",@@ -2133,16 +2104,16 @@ "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" + "signature": "'sym ==> str" }, "while": { - "description": "Executes quot2 while quot1 evaluates to true.\n \n \n Example\n \n The following program prints all natural numbers from 0 to 10:\n \n 0 :count \n (count 10 <=) \n (count puts succ @count) while", + "description": "Executes quot2 while quot1 evaluates to true.\r\n \r\n \r\n Example\r\n \r\n The following program prints all natural numbers from 0 to 10:\r\n \r\n 0 :count \r\n (count 10 <=) \r\n (count puts succ @count) while", "kind": "symbol", "name": "while", "signature": "quot1 quot2 ==> a*" }, "with": { - "description": "Pushes each item of quot1 on the stack using the scope of quot2 as scope. \n\n \n Example\n \n This operator is useful to define symbols on the [ROOT](class:kwd) scope or another scope. For example min's prelude includes the following code used to import certain modules only if min was not compiled in lite mode:\n \n 'lite? (\n (\n 'crypto import\n 'math import\n 'net import\n 'http import\n ) ROOT with\n ) unless", + "description": "Pushes each item of quot1 on the stack using the scope of quot2 as scope. \r\n\r\n \r\n Example\r\n \r\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:\r\n \r\n 'lite? (\r\n (\r\n 'crypto import\r\n 'math import\r\n 'net import\r\n 'http import\r\n ) ROOT with\r\n ) unless", "kind": "symbol", "name": "with", "signature": "quot1 quot2 ==> a*"@@ -2157,7 +2128,7 @@ "zip": {
"description": "Compresses files included in quotation quot into zip file 'sym.", "kind": "symbol", "name": "zip", - "signature": "'sym quot ==> " + "signature": "quot 'sym ==> " } }, "sigils": {@@ -2196,11 +2167,6 @@ "description": "See invoke",
"kind": "symbol", "name": "*" }, - "+": { - "description": "See module", - "kind": "symbol", - "name": "+" - }, "/": { "description": "See dget", "kind": "symbol",@@ -2235,16 +2201,6 @@ "@": {
"description": "See bind", "kind": "symbol", "name": "@" - }, - "^": { - "description": "See call", - "kind": "symbol", - "name": "^" - }, - "~": { - "description": "See delete", - "kind": "symbol", - "name": "~" } } }
@@ -181,7 +181,10 @@ minilogger.warn("Unable to process custom prelude code in $1" % customPrelude)
else: logging.warn("Unable to process custom prelude code in $1" % customPrelude) when not defined(mini): - i.eval MINRC.readFile() + try: + i.eval MINRC.readFile() + except: + error "An error occurred evaluating the .minrc file." proc interpret*(i: In, s: Stream) = i.stdLib()@@ -332,7 +335,7 @@ i.open(s, "<repl>")
var line: string while true: i.push(i.newSym("prompt")) - let vals = i.expect("string") + let vals = i.expect("str") let v = vals[0] let prompt = v.getString() stdout.write(prompt)@@ -356,7 +359,7 @@ EDITOR.completionCallback = proc(ed: LineEditor): seq[string] =
return ed.getCompletions(symbols) # evaluate prompt i.push(i.newSym("prompt")) - let vals = i.expect("string") + let vals = i.expect("str") let v = vals[0] let prompt = v.getString() line = EDITOR.readLine(prompt)
@@ -1,8 +1,8 @@
" Vim syntax file " Language: min " Maintainer: Fabio Cevasco -" Last Change: 23 Jan 2021 -" Version: 0.30.0 +" Last Change: 27 Jan 2021 +" Version: 0.31.0 if exists("b:current_syntax") finish@@ -11,7 +11,7 @@
setl iskeyword=@,36-39,+,-,*,.,/,:,~,!,48-57,60-65,94-95,192-255 setl iskeyword+=^ -syntax keyword minDefaultSymbol ! !! != # $ % & && ' * + - -> -inf . .. / : :: < <= = =% =-= == ==> => =~ > >< >= >> ? @ ROOT ^ abs accept acos aes all? and any? append apply apply-interpolate args asin ask atan atime avg bind bitand bitnot bitor bitxor bool boolean? call capitalize case cd ceil chmod choose chr clear clear-stack cleave close column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug debug! decode decode-url define define-sigil defined-sigil? defined? delete delete-sigil dequote dget dhas? dict dictionary? difference dip dir? dirname div dkeys download dpairs dpick drop dsdelete dsdelete! dset dsget dshas? dsinit dsinit! dspost dspost! dsput dsput! dsquery dsread dstore dswrite dswrite! dtype dup dvalues e encode encode-url env? error error! escape eval even? exists? exit expect expect-all expect-any expect-empty-stack fappend fatal fatal! file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-yaml fs fsize fstats ftype fwrite get get-content get-env get-stack getchr gets hardlink harvest help hidden? http id if import in? indent indexof inf infix-dequote info info! insert int integer? interpolate intersection invoke io join keep last length line-info linrec listen lite? ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match math md5 med mini? mkdir mod module mtime mv nan net newline nip not notice notice! now null? num number? odd? one? operator opts or ord os over parse parse-url partition password pi pick pop pow pred prefix prefix-dequote prepend print print! product prompt publish put-env putchr puts puts! quit quotation? quote quote-bind quote-define quote-map r2g raise random randomize range raw-args recv recv-line reduce regex reject remove remove-symbol repeat replace replace-apply request require rest return reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal seal-sigil sealed-sigil? sealed? search search-all semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack set-type sha1 shl shorten shr sigil-help sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server stop-server str string string? stringlike? strip substr succ suffix sum swap swons symbol-help symbols symlink symlink? symmetric-difference sys system system! take tan tanh tap tap! tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-yaml trunc try type type? typeclass union unless unmapkey unseal unseal-sigil unzip uppercase version warn warn! when which while with xor zip || +syntax keyword minDefaultSymbol ! != # $ % & && ' * + - -> -inf . .. / : :: < <= = =% =-= == ==> => =~ > >< >= >> ? @ ROOT _demo _dev _github _min _one _scripts _shell abs accept acos aes all? and any? append apply apply-interpolate args asin ask atan atime avg bind bitand bitnot bitor bitxor boolean boolean? capitalize case cd ceil chmod choose chr clear clear-stack cleave close cmd column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug decode decode-url define defined-sigil? defined-symbol? delete-sigil delete-symbol dequote devconfig dget dhas? dict dictionary? difference dip dir? dirname div dkeys download dpairs dpick drop dsdelete dset dsget dshas? dsinit dspost dsput dsquery dsread dstore dswrite dtype dup dvalues e encode encode-url env? error escape eval even? exists? exit expect expect-all expect-any expect-empty-stack fappend fatal file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-yaml fs fsize fstats ftype fwrite get get-content get-env get-stack getchr gets hardlink harvest help hidden? http id if import in? indent indexof inf infix-dequote info insert integer integer? interpolate intersection invoke io join keep last length line-info linrec listen lite? ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match math md4 md5 med min_symbols mini? minrc mkdir mod mtime mv nan net netstart netstop newline nip not notice now null? num number? odd? one? operator opts or ord os over parse parse-url partition password pi pick pop pow pred prefix prefix-dequote prepend print product prompt publish put-env putchr puts quit quotation? quote quote-bind quote-define quote-map r2g raise random randomize range raw-args rebuild recv recv-line reduce regex reject remove remove-symbol repeat replace replace-apply request require rest restart return reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal-sigil seal-symbol sealed-sigil? sealed-symbol? search search-all semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack sha1 sha224 sha256 sha384 sha512 shl shorten shr sigil-help sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server startshell stop-server stopshell str string string? stringlike? strip substr succ suffix sum swap swons symbol-help symbols symdir symlink symlink? symmetric-difference sys system take tan tanh tap tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-yaml tobin trunc try type type? typeclass union unless unmapkey unseal-sigil unseal-symbol unzip uppercase version vscode warn when which while with xor zip || syntax match minDefaultSigil ;\<[/:@'~!?$%&=<>#^*#+]; contained syntax match minQuote ;\<['];
@@ -24,12 +24,12 @@ <Keywords name="Folders in code2, close"></Keywords>
<Keywords name="Folders in comment, open"></Keywords> <Keywords name="Folders in comment, middle"></Keywords> <Keywords name="Folders in comment, close"></Keywords> - <Keywords name="Keywords1">puts import load apply args bind bool call case define define-sigil delete delete-sigil dequote expect expect-empty-stack float foreach format-error from-json from-yaml gets if import infix-dequote int invoke linrec load load-symbol loglevel module operator opts parse prefix-dequote prompt publish quit quote quote-bind quote-define raise read remove-symbol require reverse-expect-dequote return save-symbol scope saved-symbols scope-sigils scope-symbols seal seal-sigil set-type sigils source string symbols tap times to-json to-yaml try typeclass unless unseal unseal-sigil when while with clear-stack cleave cons dip dup get-stack id keep nip over pick pop rolldown rollup set-stack sip spread swap swons append get concat drop filter find first flatten harvest insert last map map-reduce partition prepend quote-map reduce reject remove rest reverse set shorten size slice sort take ddup ddel dget dkeys dpick dpairs dset dtype dvalues dsdelete dsget dsinit dspost dsput dsquery dsread dswrite ask choose clear column-print confirm debug error fappend fatal fread fwrite getchr info mapkey newline notice password print putchr type unmapkey warning atime ctime fperms fsize fstats ftype mtime expect-all expect-any apply-interpolate capitalize chr escape from-semver indent indexof interpolate join length lowercase match ord parse-url prefix repeat replace regex search semver-inc-major semver-inc-minor semver-inc-patch split strip substr suffix titleize to-semver uppercase chmod cd cp cpu dirname filename get-env hardlink ls ls-r mkdir mv os put-env rm rmdir run sleep symlink system unzip which zip div mod pred random succ sum now timestamp timeinfo to-timestamp datetime tformat aes decode encode md4 md5 sha1 sha224 sha256 sha384 sha512 acos asin atan ceil cos cosh d2r floor ln log10 log2 pow r2d round sin sinh sqrt tan tanh tau trunc accept close connect listen port recv recv-line send socket download get-content request start-server stop-server abs dsinit!</Keywords> + <Keywords name="Keywords1">puts import load apply args bind bool case define define-sigil delete-symbol delete-sigil dequote expect expect-empty-stack float foreach format-error from-json from-yaml gets if import infix-dequote int invoke linrec load load-symbol loglevel operator opts parse prefix-dequote prompt publish quit quote quote-bind quote-define raise read remove-symbol require reverse-expect-dequote return save-symbol scope saved-symbols scope-sigils scope-symbols seal-symbol seal-sigil sigils source string symbols tap times to-json to-yaml try typeclass unless unseal-symbol unseal-sigil when while with clear-stack cleave cons dip dup get-stack id keep nip over pick pop rolldown rollup set-stack sip spread swap swons append get concat drop filter find first flatten harvest insert last map map-reduce partition prepend quote-map reduce reject remove rest reverse set shorten size slice sort take ddup ddel dget dkeys dpick dpairs dset dtype dvalues dsdelete dsget dsinit dspost dsput dsquery dsread dswrite ask choose clear column-print confirm debug error fappend fatal fread fwrite getchr info mapkey newline notice password print putchr type unmapkey warning atime ctime fperms fsize fstats ftype mtime expect-all expect-any apply-interpolate capitalize chr escape from-semver indent indexof interpolate join length lowercase match ord parse-url prefix repeat replace regex search semver-inc-major semver-inc-minor semver-inc-patch split strip substr suffix titleize to-semver uppercase chmod cd cp cpu dirname filename get-env hardlink ls ls-r mkdir mv os put-env rm rmdir run sleep symlink system unzip which zip div mod pred random succ sum now timestamp timeinfo to-timestamp datetime tformat aes decode encode md4 md5 sha1 sha224 sha256 sha384 sha512 acos asin atan ceil cos cosh d2r floor ln log10 log2 pow r2d round sin sinh sqrt tan tanh tau trunc accept close connect listen port recv recv-line send socket download get-content request start-server stop-server abs dsinit!</Keywords> <Keywords name="Keywords2">== >= <= > < != and expect-all expect-any or not xor</Keywords> <Keywords name="Keywords3">: + @ = # ~ ^ * > < / ? % $ ! &</Keywords> <Keywords name="Keywords4">eval exit ROOT version</Keywords> <Keywords name="Keywords5">-> =></Keywords> - <Keywords name="Keywords6">compiled? defined? lite? loglevel? all? any? in? dhas? hidden? boolean? dictionary? float? integer? null? number? quotation? type? semver? env? dir? exists? file? symlink? stringlike? even? odd? sealed?</Keywords> + <Keywords name="Keywords6">compiled? defined-symbol? lite? loglevel? all? any? in? dhas? hidden? boolean? dictionary? float? integer? null? number? quotation? type? semver? env? dir? exists? file? symlink? stringlike? even? odd? sealed-symbol?</Keywords> <Keywords name="Keywords7">puts! tap! debug! error! info! notice! print! warning! system!</Keywords> <Keywords name="Keywords8">+ - -inf * / inf nan randomize e pi</Keywords> <Keywords name="Delimiters">00" 01 02" 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
@@ -234,6 +234,12 @@ i.trace = i2.trace
raise i.push i2.stack.newVal +proc pop*(i: In): MinValue = + if i.stack.len > 0: + return i.stack.pop + else: + raiseEmptyStack() + # Inherit file/line/column from current symbol proc pushSym*(i: In, s: string) = i.push MinValue(@@ -262,10 +268,10 @@ i.apply i.scope.getSymbol(symbol)
else: # Check if symbol ends with ! (auto-popping) if symbol.len > 1 and symbol[symbol.len-1] == '!': - let apSymbol = symbol[0..symbol.len-1] + let apSymbol = symbol[0..symbol.len-2] if i.scope.hasSymbol(apSymbol): i.apply i.scope.getSymbol(apSymbol) - i.pushSym "pop" + discard i.pop else: var qIndex = symbol.find('"') if qIndex > 0:@@ -288,12 +294,6 @@ var v = i.copyDict(val)
i.stack.add(v) else: i.stack.add(val) - -proc pop*(i: In): MinValue = - if i.stack.len > 0: - return i.stack.pop - else: - raiseEmptyStack() proc peek*(i: MinInterpreter): MinValue = if i.stack.len > 0:
@@ -189,9 +189,9 @@ of "'sym":
return value.isStringLike of "sym": return value.isSymbol - of "float": + of "flt": return value.isFloat - of "string": + of "str": return value.isString of "a": return true@@ -230,7 +230,7 @@ proc validate*(i: In, value: MinValue, t: string): bool =
return i.basicValidate(value, t) proc validType*(i: In, s: string): bool = - const ts = ["bool", "null", "int", "num", "float", "quot", "dict", "'sym", "sym", "string", "a"] + const ts = ["bool", "null", "int", "num", "flt", "quot", "dict", "'sym", "sym", "str", "a"] if ts.contains(s): return true if i.scope.hasSymbol("type:$#" % s):
@@ -7,7 +7,7 @@ case v.kind:
of minInt: return "int" of minFloat: - return "float" + return "flt" of minDictionary: if v.isTypedDictionary: return "dict:" & v.objType@@ -16,7 +16,7 @@ return "dict"
of minQuotation: return "quot" of minString: - return "string" + return "str" of minSymbol: return "sym" of minNull:
@@ -63,13 +63,13 @@ res = i.dset(res, "body", b.newVal)
i.push res def.symbol("get-content") do (i: In): - let vals = i.expect "string" + let vals = i.expect "str" let url = vals[0] let cli = newCli() i.push cli.getContent(url.getString).newVal def.symbol("download") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") let file = vals[0] let url = vals[1] let cli = newCli()
@@ -88,7 +88,7 @@ def.symbol("getchr") do (i: In):
i.push getchr().newVal def.symbol("putchr") do (i: In): - let ch = i.expect("string") + let ch = i.expect("str") if ch[0].getString.len != 1: raiseInvalid("Symbol putch requires a string containing a single character.") putchr(ch[0].getString[0].cint)@@ -99,13 +99,13 @@ i.push ed.password("Enter Password: ").newVal
def.symbol("ask") do (i: In) {.gcsafe.}: var ed = initEditor() - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0] i.push ed.readLine(s.getString & ": ").newVal def.symbol("confirm") do (i: In) {.gcsafe.}: var ed = initEditor() - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0] proc confirm(): bool = let answer = ed.readLine(s.getString & " [yes/no]: ")@@ -152,7 +152,7 @@ let a = i.peek
a.print def.symbol("fread") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let file = vals[0].strVal var contents = "" if MINCOMPILED:@@ -164,13 +164,13 @@ contents = file.readFile
i.push newVal(contents) def.symbol("fwrite") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") let a = vals[0] let b = vals[1] a.strVal.writeFile(b.strVal) def.symbol("fappend") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") let a = vals[0] let b = vals[1] var f:File
@@ -35,7 +35,7 @@
when not defined(mini): def.symbol("from-json") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0] i.push i.fromJson(s.getString.parseJson)@@ -346,7 +346,7 @@ q.add s.newVal
scope = scope.parent i.push q.newVal - def.symbol("defined?") do (i: In): + def.symbol("defined-symbol?") do (i: In): let vals = i.expect("'sym") i.push(i.scope.hasSymbol(vals[0].getString).newVal)@@ -354,7 +354,7 @@ def.symbol("defined-sigil?") do (i: In):
let vals = i.expect("'sym") i.push(i.scope.hasSigil(vals[0].getString).newVal) - def.symbol("sealed?") do (i: In): + def.symbol("sealed-symbol?") do (i: In): let vals = i.expect("'sym") i.push i.scope.getSymbol(vals[0].getString).sealed.newVal@@ -394,7 +394,7 @@ def.symbol("mini?") do (i: In):
i.push defined(mini).newVal def.symbol("from-yaml") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0] try: var dict = newDict(i.scope)@@ -460,24 +460,6 @@ if i.scope.symbols.hasKey(symbol) and i.scope.symbols[symbol].sealed:
raiseUndefined("Attempting to redefine sealed symbol '$1'" % [symbol]) i.scope.symbols[symbol] = MinOperator(kind: minValOp, val: q1, sealed: false, quotation: isQuot) - def.symbol("define-sigil") do (i: In): - let vals = i.expect("'sym", "a") - let sym = vals[0] - var q1 = vals[1] # existing (auto-quoted) - var sigil: string - var isQuot = true - if not q1.isQuotation: - q1 = @[q1].newVal - isQuot = false - sigil = sym.getString - when not defined(mini): - if not sigil.match USER_SYMBOL_REGEX: - raiseInvalid("Sigil identifier '$1' contains invalid characters." % sigil) - info "[sigil] $1 = $2" % [sigil, $q1] - if i.scope.sigils.hasKey(sigil) and i.scope.sigils[sigil].sealed: - raiseUndefined("Attempting to redefine sealed sigil '$1'" % [sigil]) - i.scope.sigils[sigil] = MinOperator(kind: minValOp, val: q1, sealed: true, quotation: isQuot) - def.symbol("bind") do (i: In): let vals = i.expect("'sym", "a") let sym = vals[0]@@ -493,7 +475,7 @@ let res = i.scope.setSymbol(symbol, MinOperator(kind: minValOp, val: q1, quotation: isQuot))
if not res: raiseUndefined("Attempting to bind undefined symbol: " & symbol) - def.symbol("delete") do (i: In): + def.symbol("delete-symbol") do (i: In): let vals = i.expect("'sym") let sym = vals[0] let res = i.scope.delSymbol(sym.getString)@@ -506,15 +488,6 @@ let sym = vals[0]
let res = i.scope.delSigil(sym.getString) if not res: raiseUndefined("Attempting to delete undefined sigil: " & sym.getString) - - def.symbol("module") do (i: In): - let vals = i.expect("'sym", "dict") - let name = vals[0] - var code = vals[1] - code.objType = "module" - code.filename = i.filename - info("[module] $1 ($2 symbols)" % [name.getString, $code.scope.symbols.len]) - i.scope.symbols[name.getString] = MinOperator(kind: minValOp, val: code) def.symbol("scope") do (i: In): var dict = newDict(i.scope.parent)@@ -634,7 +607,7 @@ i.debug "[import] $1" % [sig]
i.scope.sigils[sig] = val def.symbol("eval") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0] i.eval s.strVal@@ -643,7 +616,7 @@ i.push 0.newVal
i.pushSym "exit" def.symbol("parse") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0] i.push i.parse s.strVal@@ -657,17 +630,17 @@ i.push sym.val
else: raiseInvalid("No source available for native symbol '$1'." % str) - def.symbol("call") do (i: In): - let vals = i.expect("'sym", "dict") - let symbol = vals[0] - let q = vals[1] - let s = symbol.getString - let origScope = i.scope - i.scope = q.scope - i.scope.parent = origScope - let sym = i.scope.getSymbol(s) - i.apply(sym) - i.scope = origScope + # def.symbol("call") do (i: In): + # let vals = i.expect("'sym", "dict") + # let symbol = vals[0] + # let q = vals[1] + # let s = symbol.getString + # let origScope = i.scope + # i.scope = q.scope + # i.scope.parent = origScope + # let sym = i.scope.getSymbol(s) + # i.apply(sym) + # i.scope = origScope def.symbol("invoke") do (i: In): let vals = i.expect("'sym")@@ -680,16 +653,12 @@ for p in 0..parts.len-2:
let vals = i.expect("dict") let mdl = vals[0] let symId = parts[p+1] - i.push mdl - i.push symId.newVal - i.pushSym "call" - - def.symbol("set-type") do (i: In): - let vals = i.expect("'sym", "dict") - let symbol = vals[0] - var d = vals[1] - d.objType = symbol.getString - i.push d + let origScope = i.scope + i.scope = mdl.scope + i.scope.parent = origScope + let sym = i.scope.getSymbol(symId) + i.apply(sym) + i.scope = origScope def.symbol("raise") do (i: In): let vals = i.expect("dict")@@ -916,7 +885,7 @@
def.symbol("version") do (i: In): i.push pkgVersion.newVal - def.symbol("seal") do (i: In): + def.symbol("seal-symbol") do (i: In): let vals = i.expect("'sym") let sym = vals[0].getString var s = i.scope.getSymbol(sym)@@ -930,7 +899,7 @@ var s = i.scope.getSigil(sym)
s.sealed = true i.scope.setSigil(sym, s) - def.symbol("unseal") do (i: In): + def.symbol("unseal-symbol") do (i: In): let vals = i.expect("'sym") let sym = vals[0].getString var s = i.scope.getSymbol(sym)@@ -950,7 +919,7 @@ s.sealed = false
i.scope.setSigil(sym, s, true) def.symbol("quote-bind") do (i: In): - let vals = i.expect("string", "a") + let vals = i.expect("str", "a") let s = vals[0] let m = vals[1] i.push @[m].newVal@@ -958,7 +927,7 @@ i.push s
i.pushSym "bind" def.symbol("quote-define") do (i: In): - let vals = i.expect("string", "a") + let vals = i.expect("str", "a") let s = vals[0] let m = vals[1] i.push @[m].newVal@@ -1037,7 +1006,7 @@ def.symbol("string") do (i: In):
let s = i.pop i.push(($$s).newVal) - def.symbol("bool") do (i: In): + def.symbol("boolean") do (i: In): let v = i.pop let strcheck = (v.isString and (v.getString == "false" or v.getString == "")) let intcheck = v.isInt and v.intVal == 0@@ -1049,7 +1018,7 @@ i.push false.newVal
else: i.push true.newVal - def.symbol("int") do (i: In): + def.symbol("integer") do (i: In): let s = i.pop if s.isString: i.push s.getString.parseInt.newVal@@ -1094,27 +1063,18 @@
# Sigils def.sigil("'") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0] i.push(@[i.newSym(s.strVal)].newVal) def.sigil(":") do (i: In): i.pushSym("define") - def.sigil("~") do (i: In): - i.pushSym("delete") - def.sigil("?") do (i: In): i.pushSym("help") def.sigil("@") do (i: In): i.pushSym("bind") - - def.sigil("+") do (i: In): - i.pushSym("module") - - def.sigil("^") do (i: In): - i.pushSym("call") def.sigil("*") do (i: In): i.pushSym("invoke")@@ -1150,9 +1110,6 @@ i.pushSym("help")
def.symbol("@") do (i: In): i.pushSym("bind") - - def.symbol("^") do (i: In): - i.pushSym("call") def.symbol("'") do (i: In): i.pushSym("quote")
@@ -93,7 +93,7 @@ client.obj = clientSocket[].addr
i.push client def.symbol("connect") do (i: In): - let vals = i.expect("int", "string", "dict:socket") + let vals = i.expect("int", "str", "dict:socket") let port = vals[0] let address = vals[1] var skt = vals[2]@@ -106,7 +106,7 @@ skt.obj = socket[].addr
i.push skt def.symbol("send") do (i: In): - let vals = i.expect("string", "dict:socket") + let vals = i.expect("str", "dict:socket") let msg = vals[0] let skt = vals[1] skt.toSocket.send msg.getString
@@ -17,7 +17,7 @@ proc str_module*(i: In) =
let def = i.define() def.symbol("interpolate") do (i: In): - let vals = i.expect("quot", "string") + let vals = i.expect("quot", "str") var q = vals[0] let s = vals[1] var strings = newSeq[string](0)@@ -101,19 +101,19 @@ let s = vals[0]
i.push s.getString.split(" ").mapIt(it.capitalizeAscii).join(" ").newVal def.symbol("repeat") do (i: In): - let vals = i.expect("int", "string") + let vals = i.expect("int", "str") let n = vals[0] let s = vals[1] i.push s.getString.repeat(n.intVal).newVal def.symbol("indent") do (i: In): - let vals = i.expect("int", "string") + let vals = i.expect("int", "str") let n = vals[0] let s = vals[1] i.push s.getString.indent(n.intVal).newVal def.symbol("indexof") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") let reg = vals[0] let str = vals[1] let index = str.strVal.find(reg.strVal)@@ -122,17 +122,17 @@
when not defined(mini): def.symbol("encode-url") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0].strVal i.push s.encodeUrl.newVal def.symbol("decode-url") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0].strVal i.push s.decodeUrl.newVal def.symbol("parse-url") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let s = vals[0].strVal let u = s.parseUri var d = newDict(i.scope)@@ -147,7 +147,7 @@ i.dset(d, "anchor", u.anchor.newVal)
i.push d def.symbol("search") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") let reg = vals[0] let str = vals[1] var matches = str.strVal.search(reg.strVal, "m")@@ -157,7 +157,7 @@ res[i] = matches[i].newVal
i.push res.newVal def.symbol("match") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") let reg = vals[0] let str = vals[1] if str.strVal.match(reg.strVal):@@ -166,7 +166,7 @@ else:
i.push false.newVal def.symbol("search-all") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") var res = newSeq[MinValue](0) let reg = vals[0].strVal let str = vals[1].strVal@@ -179,7 +179,7 @@ res.add matches.newVal
i.push res.newVal def.symbol("replace-apply") do (i: In): - let vals = i.expect("quot", "string", "string") + let vals = i.expect("quot", "str", "str") let q = vals[0] let reg = vals[1] let s_find = vals[2]@@ -195,14 +195,14 @@ return i2.pop.getString
i.push sgregex.replacefn(s_find.strVal, reg.strVal, "", repFn).newVal def.symbol("replace") do (i: In): - let vals = i.expect("string", "string", "string") + let vals = i.expect("str", "str", "str") let s_replace = vals[0] let reg = vals[1] let s_find = vals[2] i.push sgregex.replace(s_find.strVal, reg.strVal, s_replace.strVal).newVal def.symbol("regex") do (i: In): - let vals = i.expect("string", "string") + let vals = i.expect("str", "str") let reg = vals[0] let str = vals[1] let results = str.strVal =~ reg.strVal@@ -212,12 +212,12 @@ res.add(r.newVal)
i.push res.newVal def.symbol("semver?") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let v = vals[0].strVal i.push v.match("^\\d+\\.\\d+\\.\\d+$").newVal def.symbol("from-semver") do (i: In): - let vals = i.expect("string") + let vals = i.expect("str") let v = vals[0].strVal let parts = v.search("^(\\d+)\\.(\\d+)\\.(\\d+)$") if parts[0].len == 0:
@@ -175,7 +175,7 @@ let ms = vals[0]
sleep ms.intVal.int def.symbol("chmod") do (i: In): - let vals = i.expect("int", "string") + let vals = i.expect("int", "str") let perms = vals[0] let s = vals[1] s.getString.setFilePermissions(perms.intVal.toFilePermissions)
@@ -65,7 +65,7 @@ time = t.floatVal.int64.fromUnix
i.push time.utc.format("yyyy-MM-dd'T'HH:mm:ss'Z'").newVal def.symbol("tformat") do (i: In): - let vals = i.expect("string", "num") + let vals = i.expect("str", "num") let s = vals[0] let t = vals[1] var time: Time
@@ -1,3 +1,17 @@
-* Implemented "auto-popping" by adding **!** to symbols. +* Implemented "auto-popping" by adding **!** at the end of any symbol. * Removed all symbols ending with **!** as auto-popping will work instead. * Improved contrast and readability of the min web site. +* Renamed **string** and **float** type names (used in operator signatures) to **str** and **flt** respectively. +* Removed **define-sigil**, use **operator** instead. +* Removed **module** and **+** (sigil); use **require** to create modules. +* Removed **call**, **^** (sigil, alias); use **invoke** to access module/dictionary symbols. +* Removed **set-type** symbol. +* Removed **~** sigil (rarely used). +* Renamed the following symbols: + * `int` -> `integer` + * `bool` -> `boolean` + * `delete` -> `delete-symbol` + * `defined?` -> `defined-symbol?` + * `seal` -> `seal-symbol` + * `sealed?` -> `sealed-symbol?` + * `unseal` -> `unseal-symbol`
@@ -23,4 +23,4 @@ 'http import
) ROOT with ) unless ; Unseal prompt symbol -'prompt unseal +'prompt unseal-symbol
@@ -14,7 +14,7 @@ {{d => [dict](class:kwd)}}
{{d1 => [dict<sub>1</sub>](class:kwd)}} {{d2 => [dict<sub>2</sub>](class:kwd)}} {{d0p => [dict<sub>\*</sub>](class:kwd)}} -{{flt => [float](class:kwd)}} +{{flt => [flt](class:kwd)}} {{i => [int](class:kwd)}} {{i1 => [int<sub>1</sub>](class:kwd)}} {{i2 => [int<sub>2</sub>](class:kwd)}}@@ -28,12 +28,12 @@ {{a1 => [a<sub>1</sub>](class:kwd)}}
{{a2 => [a<sub>2</sub>](class:kwd)}} {{a3 => [a<sub>3</sub>](class:kwd)}} {{a0p => [a<sub>\*</sub>](class:kwd)}} -{{s0p => [string<sub>\*</sub>](class:kwd)}} -{{s => [string](class:kwd)}} -{{s1 => [string<sub>1</sub>](class:kwd)}} -{{s2 => [string<sub>2</sub>](class:kwd)}} -{{s3 => [string<sub>3</sub>](class:kwd)}} -{{s4 => [string<sub>4</sub>](class:kwd)}} +{{s0p => [str<sub>\*</sub>](class:kwd)}} +{{s => [str](class:kwd)}} +{{s1 => [str<sub>1</sub>](class:kwd)}} +{{s2 => [str<sub>2</sub>](class:kwd)}} +{{s3 => [str<sub>3</sub>](class:kwd)}} +{{s4 => [str<sub>4</sub>](class:kwd)}} {{b => [bool](class:kwd)}} {{b1 => [bool<sub>1</sub>](class:kwd)}} {{b2 => [bool<sub>2</sub>](class:kwd)}}
@@ -5,21 +5,21 @@ -----
{@ _defs_.md || 0 @} -The following data types are availanle in {{m}}: +The following data types are availanle in {{m}} (with the corresponding shorthand symbols used in operator signatures in brackets): -null +null (null) : null value. -boolean +boolean (bool) : **true** or **false**. -integer +integer (int) : A 64-bit integer number like 1, 27, or -15. -float +float (flt) : A 64-bit floating-point number like 3.14 or -56.9876. -string +string (str) : A series of characters wrapped in double quotes: "Hello, World!". -quotation +quotation (quot) : A list of elements, which may also contain symbols. Quotations can be used to create heterogenous lists of elements of any data type, and also to create a block of code that will be evaluated later on (quoted program). Example: (1 2 3 + \*) -dictionary +dictionary (dict) : A key/value table. Dictionaries are implemented as an immediately-dequoted quotation, are enclosed in curly braces, and are represented by their symbol definitions. Note that dictionary keys must start with `:`and be followed by a double-quoted string, or a single word (which can be written witbout double quotes). The {#link-module||dict#} provides some operators on dictionaries. > %sidebar%
@@ -94,7 +94,6 @@ ## Sealing symbols
Finally, symbols can be sealed to prevent accidental updates or deletions. By default, all symbols defined in the core min modules are sealed, so the following code if run in min shell will result in an error: - 5 :quote ...because the symbol quote is already defined in the root scope. However, note that the following code will _not_ return an error:@@ -108,7 +107,7 @@
> %note% > Note > -> The {#link-operator||lang||unseal#} operator can be used to effectively un-seal a previously-sealed symbol. Use with caution! +> The {#link-operator||lang||unseal-symbol#} operator can be used to effectively un-seal a previously-sealed symbol. Use with caution! {#link-learn||scopes||Scopes#}
@@ -64,7 +64,7 @@ 'http import
) ROOT with ) unless ; Unseal prompt symbol -'prompt unseal +'prompt unseal-symbol ``` Essentially, this causes min to import *all* the modules (except for some if the **lite** flag was defined at compilation time) and unseals the {#link-operator||lang||prompt#} symbol so that it can be customized. If you want, you can provide your own prelude file to specify your custom behaviors, selectively import modules, and define your own symbols, like this:
@@ -17,11 +17,7 @@
* Start with a letter or an underscore (\_). * Contain zero or more letters, numbers and/or any of the following characters: `/ ! ? + * . _ -` -It is possible to define symbols using the {#link-operator||lang||define#} symbol. The following min program defines a new symbol called square that duplicates the first element on the stack and multiplies the two elements: - - (dup *) "square" define - -Now, while the {#link-operator||lang||define#} symbol can be fine to define (the equivalent of) variables and simple operators, it is typically better to use the {#link-operator||lang||operator#} symbol instead, as it provides better readability, additional checks and automatic input/output capturing. The previous `square` symbol could also be defined with the {#link-operator||lang||operator#} operator like this: +It is possible to define operator symbols using the {#link-operator||lang||operator#} symbol. The following min program defines a new symbol called square that duplicates the first element on the stack and multiplies the two elements: ( symbol square@@ -30,32 +26,27 @@ (n dup * @result)
) operator ;; Calculates the square of n. -In this case, note how inputs and outputs are captured into the `n` and `result` symbols in the signature quotation and then referenced in the body quotation. Sure, the original version was much more succinct, but this is definitely more readable. + The {#link-operator||lang||operator#} symbol provides way to: + * Specify the name of the symbol operator (**square** in this case) + * Specify a signature to identify the type of the input and output values (in this case, the operator takes a numeric input value and produces a numeric output value). Also, note how inputs and outputs are captured into the `n` and `result` symbols in the signature quotation and then referenced in the body quotation. + * Specify a quotation containing the code that the operator will execute. -Also, symbols defined with the {#link-operator||lang||operator#} symbol can be annotated with documentation comments (starting with `;;` or wrapped in `#|| ... ||#`)) so that a help text can be displayed using the {#link-operator||lang||help#} symbol. +Also, symbol operator definitions can be annotated with documentation comments (starting with `;;` or wrapped in `#|| ... ||#`)) so that a help text can be displayed using the {#link-operator||lang||help#} symbol. -Besides symbols, you can also define sigils. min provides a set of predefined _sigils_ as abbreviations for for commonly-used symbols. For example, the previous definition could be rewritten as follows using sigils: +Besides symbols, you can also define sigils. min provides a set of predefined _sigils_ as abbreviations for for commonly-used symbols. - (dup *) :square +A sigil can be prepended to a double-quoted string or a single word (with no spaces) which will be treated as a string instead of using the corresponding symbol. -A sigil like `:` can be prepended to a double-quoted string or a single word (with no spaces) which will be treated as a string instead of using the corresponding symbol. - -For example, the following executes the command `ls -al` and pushes the command return code on the atack: +For example, the following executes the command `ls -al` and pushes the command return code on the stack: !"ls -al"` Currently min provides the following sigils: -+ -: Alias for {#link-operator||lang||module#}. -~ -: Alias for {#link-operator||lang||delete#}. ' : Alias for {#link-operator||lang||quote#}. \: : Alias for {#link-operator||lang||define#}. -^ -: Alias for {#link-operator||lang||call#}. * : Alias for {#link-operator||lang||invoke#}. @@@ -83,27 +74,29 @@ : Alias for {#link-operator||sys||get-env#}.
Besides system sigils, you can also create your own sigils. Unlike system sigils however, user defined sigils: -* have the same character restricrions as symbols +* have the same character restrictions as symbols * can only be prepended to double-quoted strings * can be unsealed, deleted, redefined, and sealed. Sigils can be a very powerful construct and a way to reduce boulerplate code: you can define a sigil to use as you would use any symbol which requires a single string or quoted symbol on the stack. -Consider the following example: - - 'from-json 'j define-sigil - -This will define a `j` sigil that will parse any string as JSON and convert it to its corresponding min representation. - -Sigils can also (and should!) be defined with the {#link-operator||lang||operator#} operator to add additional checks. The sigil definition above could be rewritten like this, for example: +Like symbols, sigils can be defined with the {#link-operator||lang||operator#} operator, like this: ( sigil j - (str :json ==> a :result) + (string :json ==> a :result) (json from-json @result) ) operator -Also, symbols defined with the {#link-operator||lang||operator#} symbol can be annotated with documentation comments (starting with `;;` or wrapped in `#|| ... ||#`)`) so that a help text can be displayed using the {#link-operator||lang||help#} symbol. +This definition will add a `j` sigil that will process the follwing string as JSON code, so for example: + + j"{\"test\": true}" + +...will push the following dictionary on the stack: + + {true :test} + +Also, sigil definitions can be annotated with documentation comments (starting with `;;` or wrapped in `#|| ... ||#`)`) so that a help text can be displayed using the {#link-operator||lang||help#} symbol. ## Auto-popping@@ -126,7 +119,7 @@ In this case for example tbe `square` symbol expects a number on the stack, which will be captured to tbe symbol `n` and it will place a number on the stack which needs to be bound in the operator body to the symbol `result`.
In a signature, a type expression must precede the capturing symbol. Such type expression can be: -* One of the following shorthand symbols identifying a well-known {{m}} base type (see the {#link-page||reference||reference#} section for more information): `a`, `bool`, `null`, `str`, `int`, `num`, `float`, `'sym`, `quot`, or `dict`. +* One of the following shorthand symbols identifying a well-known {{m}} base type (see the {#link-page||reference||reference#} section for more information): `a`, `bool`, `null`, `str`, `int`, `num`, `flt`, `'sym`, `quot`, or `dict`. * A typed dictionary like `dict:module` or `dict:datastore`. * A type class (see below). * a union of types/typed dictionaries/type classes, like `str|int`.@@ -170,7 +163,7 @@ (
symbol add ((string|num|quot :t) :a t :b ==> t :result) ( - (a type "string" ==) + (a type "str" ==) (a b suffix @result return) when (a type "num" ==)
@@ -30,7 +30,7 @@ ---------------------------------------------------------------|--------------
...a string | Auto-completes the current word using file and directory names. ...a word starting with `!`, `!!`, `!"` `!!"`, `&`, `&"` | Auto-completes the current word using executable file names. ...a word starting with `$` | Auto-completes the current word using environment variable names. -...a word starting with `'`, `~`, `@`, `#`, `>`, `<`, `*`, `(`, `?` | Auto-completes the current word using symbol names. +...a word starting with `'`, `@`, `#`, `>`, `<`, `*`, `(`, `?` | Auto-completes the current word using symbol names. Additionally, the following common shortcuts are also available:
@@ -14,14 +14,6 @@ {#alias||:||define#}
{#alias||::||operator#} -{#sig||~||delete#} - -{#sig||+||module#} - -{#sig||^||call#} - -{#alias||^||call#} - {#sig||?||help#} {#alias||?||help#}@@ -75,9 +67,6 @@ > * If {{any}} is a numeric value, zero is converted to {{f}}, otherwise it is converted to {{t}}.
> * If {{any}} is a quotation or a dictionary, the empty quotation or dictionary is converted to {{f}}, otherwise it is converted to {{t}}. > * If {{any}} is a string, the empty string, and `"false"` are converted to {{f}}, otherwise it is converted to {{t}}.#} -{#op||call||{{d}} {{sl}}||{{a0p}}|| -Calls operator {{sl}} defined in dictionary {{d}}. #} - {#op||case||(({{q1}} {{q2}}){{0p}})||{{a0p}}|| > This operator takes a quotation containing _n_ different conditional branches. >@@ -106,13 +95,13 @@
{#op||define-sigil||{{any}} {{sl}}||{{none}}|| Defines a new sigil {{sl}}, containing the specified value (auto-quoted if not already a quotation).#} -{#op||defined?||{{sl}}||{{b}}|| +{#op||defined-symbol?||{{sl}}||{{b}}|| Returns {{t}} if the symbol {{sl}} is defined, {{f}} otherwise.#} {#op||defined-sigil?||{{sl}}||{{b}}|| Returns {{t}} if the symbol {{sl}} is defined, {{f}} otherwise.#} -{#op||delete||{{sl}}||{{none}}|| +{#op||delete-sigil||{{sl}}||{{none}}|| Deletes the specified symbol {{sl}}.#} {#op||delete-sigil||{{sl}}||{{none}}||@@ -170,9 +159,14 @@ > Formats the error {{e}} as a string.
> > %sidebar% > > Example > > -> > The following: +> > The following code: > > -> > `{"MyError" :error "This is a test error" :message} 'error set-type format-error` +> > ( +> > ( +> > {"MyError" :error "This is a test error" :message} raise +> > ) +> > (format-error) +> > ) try > > > > produces: `"This is a test error"`#}@@ -281,9 +275,6 @@ > > The default logging level is _notice_.#}
{#op||loglevel?||{{none}}||{{s}}|| Returns the current log level (debug, info, notive, warn, error or fatal). #} - -{#op||module||{{d}} {{sl}}||{{none}}|| -Creates a new module {{sl}} based on dictionary {{d}}. #} {#op||operator||{{q}}||{{a0p}}|| > 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.@@ -425,20 +416,17 @@
{#op||scope-symbols||{{d}}||({{s0p}})|| Returns a list of all symbols defined in dictionary {{d}}.#} -{#op||seal||{{sl}}||{{none}}|| +{#op||seal-symbol||{{sl}}||{{none}}|| Seals symbol {{sl}}, so that it cannot be re-assigned. #} {#op||seal-sigil||{{sl}}||{{none}}|| Seals the user-defined sigil {{sl}}, so that it cannot be re-defined. #} -{#op||sealed?||{{sl}}||{{b}}|| +{#op||sealed-symbol?||{{sl}}||{{b}}|| Returns {{t}} if the symbol {{sl}} is sealed, {{f}} otherwise.#} {#op||sealed-sigil?||{{sl}}||{{b}}|| Returns {{t}} if the sigil {{sl}} is sealed, {{f}} otherwise.#} - -{#op||set-type||{{d}} {{sl}}||{{d}}|| -Sets the type for dictionary {{d}} to {{sl}}.#} {#op||sigil-help||{{sl}}||{{help}}|{{null}}|| Returns the help dictionary for the sigil {{sl}}, if available, {{null}} otherwise. #}@@ -534,7 +522,7 @@
{#op||unless||{{q1}} {{q2}}||{{a0p}}|| If {{1}} evaluates to {{f}} then evaluates {{2}}.#} -{#op||unseal||{{sl}}||{{none}}|| +{#op||unseal-symbol||{{sl}}||{{none}}|| Unseals the user-defined symbol {{sl}}, so that it can be re-assigned. #} {#op||unseal-sigil||{{sl}}||{{none}}||
@@ -112,5 +112,5 @@
{#op||which||{{sl}}||{{s}}|| Returns the full path to the directory containing executable {{sl}}, or an empty string if the executable is not found in **$PATH**. #} -{#op||zip||{{sl}} {{q}}||{{none}}|| +{#op||zip||{{q}} {{sl}}||{{none}}|| Compresses files included in quotation {{q}} into zip file {{sl}}.#}
@@ -15,7 +15,7 @@ "d": "dict",
"d1": "dict1", "d2": "dict2", "d0p": "dict*", - "flt": "float", + "flt": "flt", "i": "int", "i1": "int1", "i2": "int2",@@ -29,12 +29,12 @@ "a1": "a1",
"a2": "a2", "a3": "a3", "a0p": "a*", - "s0p": "string*", - "s": "string", - "s1": "string1", - "s2": "string2", - "s3": "string3", - "s4": "string4", + "s0p": "str*", + "s": "str", + "s1": "str1", + "s2": "str2", + "s3": "str3", + "s4": "str4", "b": "bool", "b1": "bool1", "b2": "bool2",
@@ -11,7 +11,7 @@ "`([^`]+)`" :code-regex
( symbol fix-name - (string :s ==> string :result) + (str :s ==> str :result) ( s "!" (pop "!") replace-apply@@ -25,7 +25,7 @@ ) ::
;; Fixes names with special characters ( symbol process-block-markup - (string :s ==> string :result) + (str :s ==> str :result) ( s block-regex (pop "") replace-apply@@ -39,7 +39,7 @@ ;; Simplify block-level markup
( symbol process-snippets - (string :s ==> string :result) + (str :s ==> str :result) ( s snippet-regex ( 1 get :id@@ -51,7 +51,7 @@ ;; Resolves documentation snippets.
( symbol process - (string :s ==> string :result) + (str :s ==> str :result) ( s process-snippets process-block-markup strip @result )
@@ -1,25 +1,25 @@
-'test load -'test import +'test require :test +;;; -"crypto" describe +"crypto" *test/describe - ("test" md4 "db346d691d7acc4dc2625db19f9e3f52" ==) assert + ("test" md4 "db346d691d7acc4dc2625db19f9e3f52" ==) *test/assert - ("test" md5 "098f6bcd4621d373cade4e832627b4f6" ==) assert + ("test" md5 "098f6bcd4621d373cade4e832627b4f6" ==) *test/assert - ("test" sha1 "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" ==) assert + ("test" sha1 "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" ==) *test/assert - ("test" sha224 "90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809" ==) assert + ("test" sha224 "90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809" ==) *test/assert - ("test" sha256 "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ==) assert + ("test" sha256 "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" ==) *test/assert - ("test" sha384 "768412320f7b0aa5812fce428dc4706b3cae50e02a64caa16a782249bfe8efc4b7ef1ccb126255d196047dfedf17a0a9" ==) assert + ("test" sha384 "768412320f7b0aa5812fce428dc4706b3cae50e02a64caa16a782249bfe8efc4b7ef1ccb126255d196047dfedf17a0a9" ==) *test/assert - ("test" sha512 "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" ==) assert + ("test" sha512 "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff" ==) *test/assert - ("test" encode decode "test" ==) assert + ("test" encode decode "test" ==) *test/assert - ("test" "test" aes "test" aes strip "test" ==) assert + ("test" "test" aes "test" aes strip "test" ==) *test/assert - report + *test/report clear-stack
@@ -1,33 +1,33 @@
-'test load -'test import +'test require :test +;;; -"dict" describe +"dict" *test/describe - ((("a" 1)("b" 2)("c" 3)) dictionary? not) assert + ((("a" 1)("b" 2)("c" 3)) dictionary? not) *test/assert - ({1 :a 2 :b 3 :c} dictionary?) assert + ({1 :a 2 :b 3 :c} dictionary?) *test/assert - ({1 :a 2 :b 3 :c} 'b dget 2 ==) assert + ({1 :a 2 :b 3 :c} 'b dget 2 ==) *test/assert - ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) assert + ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) *test/assert - ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) assert + ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) *test/assert - ({1 :a 2 :b 3 :c} :dict1 dict1 'b ddel {1 :a 3 :c} ==) assert + ({1 :a 2 :b 3 :c} :dict1 dict1 'b ddel {1 :a 3 :c} ==) *test/assert - ({1 :a 2 :b 3 :c} dkeys ("a" "b" "c") ==) assert + ({1 :a 2 :b 3 :c} dkeys ("a" "b" "c") ==) *test/assert - ({1 :a 2 :b 3 :c} dvalues (1 2 3) ==) assert + ({1 :a 2 :b 3 :c} dvalues (1 2 3) ==) *test/assert - (ROOT dtype "module" ==) assert + (ROOT dtype "module" ==) *test/assert - ({} dtype "" ==) assert + ({} dtype "" ==) *test/assert - ({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) assert + ({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) *test/assert - (2 2 {+ :plus} ^plus 4 ==) assert + (2 2 {+ :plus} ^plus 4 ==) *test/assert - (2 {(2 3 +) :sum} /sum -> + 7 ==) assert + (2 {(2 3 +) :sum} /sum -> + 7 ==) *test/assert ( {} :archives@@ -38,7 +38,7 @@ article /a :code
{code :code} => archives swap code dset @archives ) foreach - archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) assert + archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) *test/assert ( {} :archives@@ -51,7 +51,7 @@ code %code
:archive archives archive code dset @archives ) foreach - archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) assert + archives {{"a" :code} :a {"aa" :code} :aa {"aaa" :code} :aaa} ==) *test/assert - report - clear-stack + *test/report + clear-stack
@@ -1,9 +1,9 @@
-'test load -'test import +'test require :test +;;; -"dstore" describe +"dstore" *test/describe - ("dstore.json" dsinit type "dict:datastore" ==) assert + ("dstore.json" dsinit type "dict:datastore" ==) *test/assert ( "dstore.json" dsread :ds@@ -13,7 +13,7 @@ 1 %test1
2 %test2 dspost dswrite "tests" (pop true) dsquery size 1 == - ) assert + ) *test/assert ( "dstore.json" dsread :ds@@ -23,15 +23,15 @@ 1 %test1
3 %test3 dsput dswrite "tests" (/test1 1 ==) dsquery size 2 == - ) assert + ) *test/assert ( "dstore.json" dsread :ds ds "tests/aaa" dsdelete "tests" (/id "aaa" ==) dsquery size 0 == - ) assert + ) *test/assert "dstore.json" rm - report - clear-stack + *test/report + clear-stack
@@ -1,20 +1,20 @@
-'test load -'test import +'test require :test +;;; -"fs" describe +"fs" *test/describe "TEST" "test.txt" fwrite - ("test.txt" fsize 4 ==) assert + ("test.txt" fsize 4 ==) *test/assert - ("test.txt" fperms 644 >=) assert + ("test.txt" fperms 644 >=) *test/assert - ("test.txt" ftype "file" ==) assert + ("test.txt" ftype "file" ==) *test/assert - ("test.txt" hidden? false ==) assert + ("test.txt" hidden? false ==) *test/assert - ("test.txt" fstats 'type dget "file" ==) assert + ("test.txt" fstats 'type dget "file" ==) *test/assert - report + *test/report clear-stack "test.txt" rm
@@ -1,14 +1,14 @@
-'test load -'test import +'test require :test +;;; -"http" describe +"http" *test/describe "postman-echo.com" :host "https://$1" (host) => % :url - ("$1/get" (url) => % get-content from-json /headers /user-agent "min http-module/$1" (version) => % ==) assert + ("$1/get" (url) => % get-content from-json /headers /user-agent "min http-module/$1" (version) => % ==) *test/assert - ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json /args /test "Hello!" ==) assert + ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json /args /test "Hello!" ==) *test/assert "tests/test1.json" rm (@@ -18,7 +18,7 @@ ("GET" %method)
({"it-it" :Accept-Language} %headers) (request) ) tap /body from-json /headers /accept-language "it-it" == - ) assert + ) *test/assert ( {} (@@ -27,7 +27,7 @@ ("PUT" %method)
({} to-json %body) (request) ) tap /body from-json /data {} == - ) assert + ) *test/assert ( {} (@@ -36,7 +36,7 @@ ("POST" %method)
({"post" :test} to-json %body) (request) ) tap /headers /content-type "^application/json" match - ) assert + ) *test/assert ( {} (@@ -45,7 +45,7 @@ ("PATCH" %method)
({} to-json %body) (request) ) tap /body from-json /data {} == - ) assert + ) *test/assert ( {} (@@ -53,8 +53,7 @@ ("$1/delete" (url) => % %url)
("DELETE" %method) (request) ) tap /body from-json /url "https://$1/delete" (host) => % == - ) assert - - report - clear-stack + ) *test/assert + *test/report + clear-stack
@@ -1,14 +1,14 @@
-'test load -'test import +'test require :test +;;; -"io" describe +"io" *test/describe ("TEST" "test.txt" fwrite - "test.txt" fread "TEST" ==) assert + "test.txt" fread "TEST" ==) *test/assert (" - TEST" "test.txt" fappend - "test.txt" fread "TEST - TEST" ==) assert + "test.txt" fread "TEST - TEST" ==) *test/assert "test.txt" rm - report + *test/report clear-stack
@@ -1,17 +1,17 @@
-'test load -'test import +'test require :test +;;; -"lang" describe +"lang" *test/describe (2 'a define - (3 a + (5 'a define a) -> +) -> a + 12 ==) assert + (3 a + (5 'a define a) -> +) -> a + 12 ==) *test/assert - (symbols "a" in? false ==) assert + (symbols "a" in? false ==) *test/assert - ('abcdefg defined? false ==) assert + ('abcdefg defined-symbol? false ==) *test/assert 5 :five - (symbols "five" in?) assert + (symbols "five" in?) *test/assert ( ((1 2 3 4 5 6)) :test-data@@ -27,106 +27,90 @@ test-data (def) foreach
_2 _5 _1 + + 30 == - ) assert - - - ~five - (symbols "five" in? false ==) assert - - { - (+) :myplus - } +mymath - - (symbols "mymath" in?) assert + ) *test/assert - ('mymath import symbols "myplus" in?) assert + 'five delete-symbol + (symbols "five" in? false ==) *test/assert - ('mymath import 2 3 myplus 5 ==) assert + ("3 4 +" eval 7 ==) *test/assert - (2 3 mymath ^myplus 5 ==) assert - - ("3 4 +" eval 7 ==) assert - - ("2 2 +" "tests/testload.min" fwrite 'testload load 4 ==) assert + ("2 2 +" "tests/testload.min" fwrite 'testload load 4 ==) *test/assert "tests/testload.min" rm - ("2 :two 3 :three" "tests/testrequire.min" fwrite 'testrequire require :tm *tm/two *tm/three + 5 ==) assert + ("2 :two 3 :three" "tests/testrequire.min" fwrite 'testrequire require :tm *tm/two *tm/three + 5 ==) *test/assert "tests/testrequire.min" rm - (2 2 mymath ^myplus 4 ==) assert - + (2 quote (2) ==) *test/assert - (2 quote (2) ==) assert + ((2 3) dequote get-stack (2 3) ==) *test/assert - ((2 3) dequote get-stack (2 3) ==) assert + (3 (succ) 3 times 6 ==) *test/assert - (3 (succ) 3 times 6 ==) assert + ((2 3 >) ("YES") ("NO") if "NO" ==) *test/assert + ((2 3 <) ("YES") ("NO") if "YES" ==) *test/assert - ((2 3 >) ("YES") ("NO") if "NO" ==) assert - ((2 3 <) ("YES") ("NO") if "YES" ==) assert + ("NO" (2 3 >) ("YES") when "NO" ==) *test/assert - ("NO" (2 3 >) ("YES") when "NO" ==) assert + ((2 3 <) ("YES") when "YES" ==) *test/assert - ((2 3 <) ("YES") when "YES" ==) assert + ((2 3 >) ("YES") unless "YES" ==) *test/assert - ((2 3 >) ("YES") unless "YES" ==) assert + (1 type "int" ==) *test/assert + ({} type "dict" ==) *test/assert + (ROOT type "dict:module" ==) *test/assert - (1 type "int" ==) assert - ({} type "dict" ==) assert - (ROOT type "dict:module" ==) assert - - (5 (dup 0 ==) (1 +) (dup 1 -) ( * ) linrec 120 ==) assert ;factorial of 5 + (5 (dup 0 ==) (1 +) (dup 1 -) ( * ) linrec 120 ==) *test/assert ;factorial of 5 ( ( (pop) ('error dget) ("finally") - ) try get-stack ("MinEmptyStackError" "finally") ==) assert + ) try get-stack ("MinEmptyStackError" "finally") ==) *test/assert - ("aaaa" :cd cd "aaaa" ==) assert ;It is possible to shadow sealed symbols in child scopes + ("aaaa" :cd cd "aaaa" ==) *test/assert ;It is possible to shadow sealed symbols in child scopes - (((2 :a1 'a1 seal 3 :a1) ("failed")) try "failed" ==) assert + (((2 :a1 'a1 seal-symbol 3 :a1) ("failed")) try "failed" ==) *test/assert ( 1 :a1 - 'a1 seal - 'a1 unseal + 'a1 seal-symbol + 'a1 unseal-symbol 2 :a1 - 2 a1 ==) assert + 2 a1 ==) *test/assert ( ( ({"TestError" :error "Test Message" :message} raise) (/error) - ) try "TestError" ==) assert + ) try "TestError" ==) *test/assert ( - (("test" °test :)) try get-stack ("test") ==) assert + (("test" °test :)) try get-stack ("test") ==) *test/assert ( ( (() 1 get) (1) - ) try 1 ==) assert + ) try 1 ==) *test/assert - ((a b +) {4 :a 5 :b} with 9 ==) assert + ((a b +) {4 :a 5 :b} with 9 ==) *test/assert - ("{\"a\": 1, \"b\": 2.3}" from-json {1 :a 2.3 :b} ==) assert + ("{\"a\": 1, \"b\": 2.3}" from-json {1 :a 2.3 :b} ==) *test/assert - ((1 2 3 "aaa" 'q q true) to-json "\r\n" "" replace "\n" "" replace " " "" replace "[1,2,3,\"aaa\",\";sym:'q\",\";sym:q\",true]" ==) assert + ((1 2 3 "aaa" 'q q true) to-json "\r\n" "" replace "\n" "" replace " " "" replace "[1,2,3,\"aaa\",\";sym:'q\",\";sym:q\",true]" ==) *test/assert - ((1 2 3 "aaa" 'q q true) to-json from-json (1 2 3 "aaa" 'q q true) ==) assert + ((1 2 3 "aaa" 'q q true) to-json from-json (1 2 3 "aaa" 'q q true) ==) *test/assert - (((1 2 3)) :sym1 >sym1 saved-symbols "sym1" in?) assert + (((1 2 3)) :sym1 >sym1 saved-symbols "sym1" in?) *test/assert - (<sym1 symbols "sym1" in?) assert + (<sym1 symbols "sym1" in?) *test/assert - ('sym1 remove-symbol saved-symbols "sym1" in? false ==) assert + ('sym1 remove-symbol saved-symbols "sym1" in? false ==) *test/assert - (0 :temp (1 2 3) (temp + @temp) foreach 6 temp ==) assert + (0 :temp (1 2 3) (temp + @temp) foreach 6 temp ==) *test/assert - ((1 +) :mysucc 'mysucc source (1 +) ==) assert + ((1 +) :mysucc 'mysucc source (1 +) ==) *test/assert (6 (@@ -134,45 +118,45 @@ ((3 ==) (false))
((3 <) (false)) ((3 >) (true)) ) case - ) assert + ) *test/assert - (time scope-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) assert + (time scope-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) *test/assert - (sys scope-sigils ("!" "$" "&") ==) assert + (sys scope-sigils ("!" "$" "&") ==) *test/assert - ({3 :a 5 :b} scope-symbols ("a" "b") ==) assert + ({3 :a 5 :b} scope-symbols ("a" "b") ==) *test/assert - (opts {} ==) assert + (opts {} ==) *test/assert - (args first "\.min$" match) assert + (args first "\.min$" match) *test/assert - (3 string "3" ==) assert + (3 string "3" ==) *test/assert - ("false" bool false ==) assert + ("false" boolean false ==) *test/assert - ("" bool false ==) assert + ("" boolean false ==) *test/assert - (0 bool false ==) assert + (0 boolean false ==) *test/assert - (false bool false ==) assert + (false boolean false ==) *test/assert - (0.0 bool false ==) assert + (0.0 boolean false ==) *test/assert - ("something" bool true ==) assert + ("something" boolean true ==) *test/assert - ("345" int 345 ==) assert + ("345" integer 345 ==) *test/assert - (true int 1 ==) assert + (true integer 1 ==) *test/assert - (3.5 int 3 ==) assert + (3.5 integer 3 ==) *test/assert - (3.5 float 3.5 ==) assert + (3.5 float 3.5 ==) *test/assert - (3 float 3.0 ==) assert + (3 float 3.0 ==) *test/assert - (false float 0.0 ==) assert + (false float 0.0 ==) *test/assert - ("3.678" float 3.678 ==) assert + ("3.678" float 3.678 ==) *test/assert ( {1 :a 2 :b 3 :c} (@@ -180,7 +164,7 @@ (dup /a succ succ %a)
(dup /b succ %b) ) tap {3 :a 3 :b 3 :c} == - ) assert + ) *test/assert ( {} :data@@ -189,7 +173,7 @@ 1 %a
2 %b ) tap {1 :a 2 :b} == - ) assert + ) *test/assert ( "" :s1@@ -199,36 +183,42 @@ (' "2" swap append "" join)
(' "3" swap append "" join @s1 s1) ) tap! s1 "test123" == - ) assert + ) *test/assert - (3.4 "test" 1 (int string num) expect (3.4 "test" 1) ==) assert + (3.4 "test" 1 (int str num) expect (3.4 "test" 1) ==) *test/assert - ("aaa bbb ccc 2 2 + (2 3 4)" parse (aaa bbb ccc 2 2 + (2 3 4)) ==) assert + ("aaa bbb ccc 2 2 + (2 3 4)" parse (aaa bbb ccc 2 2 + (2 3 4)) ==) *test/assert - (lite? false ==) assert + (lite? false ==) *test/assert - ({3 :x 5 :y} "point" set-type 'point type?) assert + ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) *test/assert - ({} :myscope (2 :two 3 :three scope @myscope) -> myscope scope-symbols ("three" "two") ==) assert + ((2 < 3 and (4 > 2)) >< true) *test/assert - ((2 < 3 and (4 > 2)) >< true) assert - - ((float 3) >> 3.0 ==) assert + ((float 3) >> 3.0 ==) *test/assert ( - ("--" suffix "--" prefix) 'del define-sigil + ( + sigil del + (str :in ==> str :out) + (in "--" suffix "--" prefix @out) + ) :: del"test" "--test--" == - ) assert + ) *test/assert ( - ("x" prefix) 'x define-sigil + ( + sigil x + (str :in ==> str :out) + (in "x" prefix @out) + ) :: 'x unseal-sigil 'x delete-sigil 'x defined-sigil? false == - ) assert + ) *test/assert ( {{100 :b} :a} :test *test/a/b 100 == - ) assert + ) *test/assert ( (@@ -241,12 +231,12 @@ base (dup) n times (*) n times @pr
) ) operator 2 4 pow-mul - 8 == - ) assert + ) *test/assert ( ( sigil nt - (string :s ==> bool :result) + (str :s ==> bool :result) ( ("int" s ==) (true @result return)@@ -254,18 +244,18 @@ when
("num" s ==) (true @result return) when - ("float" s ==) + ("flt" s ==) (true @result return) when "not gonna be printed if true!" puts false @result ) ) :: - nt"float" - ) assert + nt"flt" + ) *test/assert (:n ((n integer?) (n 0 >)) &&) 'natural typeclass - ("type:natural" defined?) assert + ("type:natural" defined-symbol?) *test/assert ( symbol natural-sum (natural :n natural :m ==> natural :result)@@ -277,14 +267,14 @@ (3 -3 natural-sum)
(@err) ) try pop ;Remove 3 that was left on the stack. - (err format-error "expected: natural natural natural-sum" match) assert - (2 3 natural-sum 5 ==) assert + (err format-error "expected: natural natural natural-sum" match) *test/assert + (2 3 natural-sum 5 ==) *test/assert ( symbol add - ((string|num|quot :t) :a t :b ==> t :result) + ((str|num|quot :t) :a t :b ==> t :result) ( - (a type "string" ==) + (a type "str" ==) (a b suffix @result return) when (a type "num" ==)@@ -295,9 +285,9 @@ (a b concat #result return)
when ) ) :: - ("a" "b" add "ab" ==) assert - ((1 2 3) (4 5) add (1 2 3 4 5) ==) assert + ("a" "b" add "ab" ==) *test/assert + ((1 2 3) (4 5) add (1 2 3 4 5) ==) *test/assert - report + *test/report ; Tidy up clear-stack
@@ -1,157 +1,157 @@
-'test load -'test import +'test require :test +;;; -"logic" describe +"logic" *test/describe - (2 3 <) assert - (3 2 < false ==) assert - (3 3 < false ==) assert - (2.99 3 <) assert - (2 1.99 < false ==) assert - (1.99 1.991 <) assert - (1.99 1.990 < false ==) assert - ("test1" "test2" <) assert - ("test3" "test2" < false ==) assert - ("test2" "test2" < false ==) assert + (2 3 <) *test/assert + (3 2 < false ==) *test/assert + (3 3 < false ==) *test/assert + (2.99 3 <) *test/assert + (2 1.99 < false ==) *test/assert + (1.99 1.991 <) *test/assert + (1.99 1.990 < false ==) *test/assert + ("test1" "test2" <) *test/assert + ("test3" "test2" < false ==) *test/assert + ("test2" "test2" < false ==) *test/assert - (2 3 <=) assert - (3 2 <= false ==) assert - (3 3 <=) assert - (2.99 3 <=) assert - (2 1.99 <= false ==) assert - (1.99 1.991 <=) assert - (1.99 1.990 <=) assert - ("test1" "test2" <=) assert - ("test3" "test2" <= false ==) assert - ("test2" "test2" <=) assert + (2 3 <=) *test/assert + (3 2 <= false ==) *test/assert + (3 3 <=) *test/assert + (2.99 3 <=) *test/assert + (2 1.99 <= false ==) *test/assert + (1.99 1.991 <=) *test/assert + (1.99 1.990 <=) *test/assert + ("test1" "test2" <=) *test/assert + ("test3" "test2" <= false ==) *test/assert + ("test2" "test2" <=) *test/assert - (2 3 > false ==) assert - (3 2 >) assert - (3 3 > false ==) assert - (2.99 3 > false ==) assert - (2 1.99 >) assert - (1.99 1.991 > false ==) assert - (1.99 1.990 > false ==) assert - ("test1" "test2" > false ==) assert - ("test3" "test2" >) assert - ("test2" "test2" > false ==) assert + (2 3 > false ==) *test/assert + (3 2 >) *test/assert + (3 3 > false ==) *test/assert + (2.99 3 > false ==) *test/assert + (2 1.99 >) *test/assert + (1.99 1.991 > false ==) *test/assert + (1.99 1.990 > false ==) *test/assert + ("test1" "test2" > false ==) *test/assert + ("test3" "test2" >) *test/assert + ("test2" "test2" > false ==) *test/assert - (2 3 >= false ==) assert - (3 2 >=) assert - (3 3 >=) assert - (2.99 3 >= false ==) assert - (2 1.99 >=) assert - (1.99 1.991 >= false ==) assert - (1.99 1.990 >=) assert - ("test1" "test2" >= false ==) assert - ("test3" "test2" >=) assert - ("test2" "test2" >=) assert + (2 3 >= false ==) *test/assert + (3 2 >=) *test/assert + (3 3 >=) *test/assert + (2.99 3 >= false ==) *test/assert + (2 1.99 >=) *test/assert + (1.99 1.991 >= false ==) *test/assert + (1.99 1.990 >=) *test/assert + ("test1" "test2" >= false ==) *test/assert + ("test3" "test2" >=) *test/assert + ("test2" "test2" >=) *test/assert - (true true ==) assert - (false true == false ==) assert - (true false == false ==) assert - (false false ==) assert - (1 1 ==) assert - ("aaa" "aaa" ==) assert - (1.0 1 ==) assert - ((1 2 3.0) (1.0 2 3) ==) assert - (("a" "b") ("a" "b") ==) assert - (("a" "b" 3) ("a" "b" 4) == false ==) assert - ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) ==) assert + (true true ==) *test/assert + (false true == false ==) *test/assert + (true false == false ==) *test/assert + (false false ==) *test/assert + (1 1 ==) *test/assert + ("aaa" "aaa" ==) *test/assert + (1.0 1 ==) *test/assert + ((1 2 3.0) (1.0 2 3) ==) *test/assert + (("a" "b") ("a" "b") ==) *test/assert + (("a" "b" 3) ("a" "b" 4) == false ==) *test/assert + ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) ==) *test/assert - (true true != false ==) assert - (false true !=) assert - (true false !=) assert - (false false != false ==) assert - (1 1 != false ==) assert - ("aaa" "aaa" != false ==) assert - ;(1.0 1 != false ==) assert - ;((1 2 3.0) (1.0 2.0 3) != false ==) assert - ;(("a" "b") ("a" "b") != false ==) assert - (("a" "b" 3) ("a" "b" 4) !=) assert - ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) != false ==) assert + (true true != false ==) *test/assert + (false true !=) *test/assert + (true false !=) *test/assert + (false false != false ==) *test/assert + (1 1 != false ==) *test/assert + ("aaa" "aaa" != false ==) *test/assert + ;(1.0 1 != false ==) *test/assert + ;((1 2 3.0) (1.0 2.0 3) != false ==) *test/assert + ;(("a" "b") ("a" "b") != false ==) *test/assert + (("a" "b" 3) ("a" "b" 4) !=) *test/assert + ((1 "b" 3 myrandomsymbol) (1 "b" 3.0 myrandomsymbol) != false ==) *test/assert - (false not) assert - (true not false ==) assert + (false not) *test/assert + (true not false ==) *test/assert - (true true and) assert - (true false and false ==) assert - (false true and false ==) assert - (false false and false ==) assert + (true true and) *test/assert + (true false and false ==) *test/assert + (false true and false ==) *test/assert + (false false and false ==) *test/assert - (true true or) assert - (true false or) assert - (false true or) assert - (false false or false ==) assert + (true true or) *test/assert + (true false or) *test/assert + (false true or) *test/assert + (false false or false ==) *test/assert - (true true xor false ==) assert - (true false xor) assert - (false true xor) assert - (false false xor false ==) assert + (true true xor false ==) *test/assert + (true false xor) *test/assert + (false true xor) *test/assert + (false false xor false ==) *test/assert - ("a" string?) assert - (1 string? false ==) assert - (1.0 string? false ==) assert - (true string? false ==) assert - (false string? false ==) assert - (("a" 2 c) string? false ==) assert + ("a" string?) *test/assert + (1 string? false ==) *test/assert + (1.0 string? false ==) *test/assert + (true string? false ==) *test/assert + (false string? false ==) *test/assert + (("a" 2 c) string? false ==) *test/assert - ("a" integer? false ==) assert - (1 integer?) assert - (1.0 integer? false ==) assert - (true integer? false ==) assert - (false integer? false ==) assert - (("a" 2 c) integer? false ==) assert + ("a" integer? false ==) *test/assert + (1 integer?) *test/assert + (1.0 integer? false ==) *test/assert + (true integer? false ==) *test/assert + (false integer? false ==) *test/assert + (("a" 2 c) integer? false ==) *test/assert - ("a" float? false ==) assert - (1 float? false ==) assert - (1.0 float?) assert - (true float? false ==) assert - (false float? false ==) assert - (("a" 2 c) float? false ==) assert + ("a" float? false ==) *test/assert + (1 float? false ==) *test/assert + (1.0 float?) *test/assert + (true float? false ==) *test/assert + (false float? false ==) *test/assert + (("a" 2 c) float? false ==) *test/assert - ("a" boolean? false ==) assert - (1 boolean? false ==) assert - (1.0 boolean? false ==) assert - (true boolean?) assert - (false boolean?) assert - (("a" 2 c) boolean? false ==) assert + ("a" boolean? false ==) *test/assert + (1 boolean? false ==) *test/assert + (1.0 boolean? false ==) *test/assert + (true boolean?) *test/assert + (false boolean?) *test/assert + (("a" 2 c) boolean? false ==) *test/assert - ("a" number? false ==) assert - (1 number?) assert - (1.0 number?) assert - (true number? false ==) assert - (false number? false ==) assert - (("a" 2 c) number? false ==) assert + ("a" number? false ==) *test/assert + (1 number?) *test/assert + (1.0 number?) *test/assert + (true number? false ==) *test/assert + (false number? false ==) *test/assert + (("a" 2 c) number? false ==) *test/assert - ("a" quotation? false ==) assert - (1 quotation? false ==) assert - (1.0 quotation? false ==) assert - (true quotation? false ==) assert - (false quotation? false ==) assert - (("a" 2 c) quotation?) assert + ("a" quotation? false ==) *test/assert + (1 quotation? false ==) *test/assert + (1.0 quotation? false ==) *test/assert + (true quotation? false ==) *test/assert + (false quotation? false ==) *test/assert + (("a" 2 c) quotation?) *test/assert - ("a" stringlike?) assert - (1 stringlike? false ==) assert - ('test stringlike?) assert + ("a" stringlike?) *test/assert + (1 stringlike? false ==) *test/assert + ('test stringlike?) *test/assert - ({} 'module type? false ==) assert - ((1 2 3) 'module type? false ==) assert - (4 'module type? false ==) assert - (logic 'module type?) assert - (1 "int" type?) assert - ("test" "string" type?) assert - (ROOT "module" type?) assert + ({} 'module type? false ==) *test/assert + ((1 2 3) 'module type? false ==) *test/assert + (4 'module type? false ==) *test/assert + (logic 'module type?) *test/assert + (1 "int" type?) *test/assert + ("test" "str" type?) *test/assert + (ROOT "module" type?) *test/assert - (7 0 / inf ==) assert - (-7 0 / -inf ==) assert - (0 0 / nan ==) assert - (10 3 / 3.33333 ==) assert + (7 0 / inf ==) *test/assert + (-7 0 / -inf ==) *test/assert + (0 0 / nan ==) *test/assert + (10 3 / 3.33333 ==) *test/assert - (3 "a" == not) assert - (1 () != true) assert - (3.3 'test == not) assert + (3 "a" == not) *test/assert + (1 () != true) *test/assert + (3.3 'test == not) *test/assert ( (@@ -161,7 +161,7 @@ ("a" "b" ==)
("never printed" puts!) ) && false == - ) assert + ) *test/assert ( (@@ -170,7 +170,7 @@ (2 1 <)
("a" "a" ==) ("never printed" puts!) ) || - ) assert + ) *test/assert - report - clear-stack + *test/report + clear-stack
@@ -1,35 +1,35 @@
-'test load -'test import +'test require :test +;;; -"math" describe +"math" *test/describe - (0 d2r sin 0 ==) assert + (0 d2r sin 0 ==) *test/assert - (30 d2r sin 0.5 ==) assert + (30 d2r sin 0.5 ==) *test/assert - (45 d2r sin 2 sqrt 2 / ==) assert + (45 d2r sin 2 sqrt 2 / ==) *test/assert - (60 d2r sin 3 sqrt 2 / ==) assert + (60 d2r sin 3 sqrt 2 / ==) *test/assert - (90 d2r sin 1 ==) assert + (90 d2r sin 1 ==) *test/assert - (15 d2r sin 75 d2r cos ==) assert + (15 d2r sin 75 d2r cos ==) *test/assert - (15 cos 2 pow 15 sin 2 pow + 1 ==) assert + (15 cos 2 pow 15 sin 2 pow + 1 ==) *test/assert - (pi 4 / tan 1 ==) assert + (pi 4 / tan 1 ==) *test/assert - (e 3 pow ln 3 ==) assert + (e 3 pow ln 3 ==) *test/assert - (pi floor 3 ==) assert + (pi floor 3 ==) *test/assert - (pi 2 round 3.14 ==) assert + (pi 2 round 3.14 ==) *test/assert - (pi ceil 4 ==) assert + (pi ceil 4 ==) *test/assert - (pi trunc 3 ==) assert + (pi trunc 3 ==) *test/assert - (-2.87 abs 2.87 ==) assert + (-2.87 abs 2.87 ==) *test/assert - report - clear-stack + *test/report + clear-stack
@@ -1,7 +1,7 @@
-'test load -'test import +'test require :test +;;; -"net" describe +"net" *test/describe {} socket :srv1 {} socket :srv2@@ -25,15 +25,14 @@ cli1 recv-line @line
(response line) => "\n" join puts @response ) while - (response "200 OK" match) assert + (response "200 OK" match) *test/assert - (srv1 srv2 ==) assert - (cli1 cli2 !=) assert + (srv1 srv2 ==) *test/assert + (cli1 cli2 !=) *test/assert - report + *test/report clear-stack srv1 close srv2 close cli1 close - cli2 close - + cli2 close
@@ -1,77 +1,77 @@
-'test load -'test import +'test require :test +;;; -"num" describe +"num" *test/describe - (2 2 + 4 ==) assert - (1 3.0 + 4 ==) assert - (3.1 3.9 + 7 ==) assert - (3 -2.1 + 0.8999999999999999 ==) assert + (2 2 + 4 ==) *test/assert + (1 3.0 + 4 ==) *test/assert + (3.1 3.9 + 7 ==) *test/assert + (3 -2.1 + 0.8999999999999999 ==) *test/assert - (3 3 - 0 ==) assert - (-5 -4 - -1 ==) assert - (-4 3.7 - -7.7 ==) assert + (3 3 - 0 ==) *test/assert + (-5 -4 - -1 ==) *test/assert + (-4 3.7 - -7.7 ==) *test/assert - (-2 4 * -8 ==) assert - (-2.5 -2 * 5 ==) assert - (3 3 * 9 ==) assert + (-2 4 * -8 ==) *test/assert + (-2.5 -2 * 5 ==) *test/assert + (3 3 * 9 ==) *test/assert - (5 2 / 2.5 ==) assert - (1 3 / 0.3333333333333333 ==) assert - (-3 2 / -1.5 ==) assert + (5 2 / 2.5 ==) *test/assert + (1 3 / 0.3333333333333333 ==) *test/assert + (-3 2 / -1.5 ==) *test/assert - (5 2 div 2 ==) assert - (1 3 div 0 ==) assert - (-3 2 div -1 ==) assert + (5 2 div 2 ==) *test/assert + (1 3 div 0 ==) *test/assert + (-3 2 div -1 ==) *test/assert - (5 2 mod 1 ==) assert - (4 2 mod 0 ==) assert - (-3 2 mod -1 ==) assert + (5 2 mod 1 ==) *test/assert + (4 2 mod 0 ==) *test/assert + (-3 2 mod -1 ==) *test/assert - (1000 random 1000 <) assert + (1000 random 1000 <) *test/assert - ((1 2 3 4 5) sum 15 ==) assert + ((1 2 3 4 5) sum 15 ==) *test/assert - ((1 2 3 4 5) product 120 ==) assert + ((1 2 3 4 5) product 120 ==) *test/assert - ((1 2 3 4 5) avg 3.0 ==) assert - ((1 2 3 4 5 6) avg 3.5 ==) assert + ((1 2 3 4 5) avg 3.0 ==) *test/assert + ((1 2 3 4 5 6) avg 3.5 ==) *test/assert - ((1 3 5 7) med 4.0 ==) assert - ((1 3 5 7 9) med 5 ==) assert + ((1 3 5 7) med 4.0 ==) *test/assert + ((1 3 5 7 9) med 5 ==) *test/assert - ((1 5) range (1 2 3 4 5) ==) assert - ((5 1) range (5 4 3 2 1) ==) assert - ((4 7) range (4 5 6 7) ==) assert - ((7 4) range (7 6 5 4) ==) assert - ((1 6 2) range (1 3 5) ==) assert - ((1 6 3) range (1 4) ==) assert - ((0 6 2) range (0 2 4 6) ==) assert - ((6 1 2) range (6 4 2) ==) assert - ((6 1 3) range (6 3) ==) assert - ((6 0 2) range (6 4 2 0) ==) assert + ((1 5) range (1 2 3 4 5) ==) *test/assert + ((5 1) range (5 4 3 2 1) ==) *test/assert + ((4 7) range (4 5 6 7) ==) *test/assert + ((7 4) range (7 6 5 4) ==) *test/assert + ((1 6 2) range (1 3 5) ==) *test/assert + ((1 6 3) range (1 4) ==) *test/assert + ((0 6 2) range (0 2 4 6) ==) *test/assert + ((6 1 2) range (6 4 2) ==) *test/assert + ((6 1 3) range (6 3) ==) *test/assert + ((6 0 2) range (6 4 2 0) ==) *test/assert - (2 3 bitand 2 ==) assert + (2 3 bitand 2 ==) *test/assert - (123 bitnot -124 ==) assert + (123 bitnot -124 ==) *test/assert - (2 3 bitor 3 ==) assert + (2 3 bitor 3 ==) *test/assert - (2 3 bitxor 1 ==) assert + (2 3 bitxor 1 ==) *test/assert - (2 3 shl 16 ==) assert + (2 3 shl 16 ==) *test/assert - (16 3 shr 2 ==) assert + (16 3 shr 2 ==) *test/assert (0 :c (c 10 <) (c succ @c) while - c 10 ==) assert + c 10 ==) *test/assert - ((1 2 3 4 5) (even?) filter (2 4) ==) assert + ((1 2 3 4 5) (even?) filter (2 4) ==) *test/assert - ((1 2 3 4 5) (even?) any?) assert + ((1 2 3 4 5) (even?) any?) *test/assert - ((2 4 6 8) (even?) all?) assert + ((2 4 6 8) (even?) all?) *test/assert - report - clear-stack + *test/report + clear-stack
@@ -1,89 +1,89 @@
-'test load -'test import +'test require :test +;;; -"seq" describe +"seq" *test/describe - ((1 2) (3 4) concat (1 2 3 4) ==) assert + ((1 2) (3 4) concat (1 2 3 4) ==) *test/assert - ((1 2 3) first 1 ==) assert + ((1 2 3) first 1 ==) *test/assert - ((1 2 3) last 3 ==) assert + ((1 2 3) last 3 ==) *test/assert - ((1 2 3) rest (2 3) ==) assert + ((1 2 3) rest (2 3) ==) *test/assert - (4 (1 2 3) append (1 2 3 4) ==) assert + (4 (1 2 3) append (1 2 3 4) ==) *test/assert - (0 (1 2 3) prepend (0 1 2 3) ==) assert + (0 (1 2 3) prepend (0 1 2 3) ==) *test/assert - ((1 2 3 4) 2 get 3 ==) assert + ((1 2 3 4) 2 get 3 ==) *test/assert - ((1 2 3 4) 222 2 set (1 2 222 4) ==) assert + ((1 2 3 4) 222 2 set (1 2 222 4) ==) *test/assert - ((1 2 3 4) 2 remove (1 2 4) ==) assert + ((1 2 3 4) 2 remove (1 2 4) ==) *test/assert - ((1 2 3 4) 333 2 insert (1 2 333 3 4) ==) assert + ((1 2 3 4) 333 2 insert (1 2 333 3 4) ==) *test/assert - ((1 2 3) size 3 ==) assert + ((1 2 3) size 3 ==) *test/assert - ((1 2 3 4) 5 in? false ==) assert + ((1 2 3 4) 5 in? false ==) *test/assert - ((1 2 3 4) 2 in?) assert + ((1 2 3 4) 2 in?) *test/assert - ((1 2 3 4) (2 +) map (3 4 5 6) ==) assert + ((1 2 3 4) (2 +) map (3 4 5 6) ==) *test/assert - ((5 4 3 2 1) reverse (1 2 3 4 5) ==) assert + ((5 4 3 2 1) reverse (1 2 3 4 5) ==) *test/assert - ((3 4 7 2 4 6 5 6) '> sort (2 3 4 4 5 6 6 7) ==) assert + ((3 4 7 2 4 6 5 6) '> sort (2 3 4 4 5 6 6 7) ==) *test/assert - ((3 4 7 2 4 6 5 6) '< sort (7 6 6 5 4 4 3 2) ==) assert + ((3 4 7 2 4 6 5 6) '< sort (7 6 6 5 4 4 3 2) ==) *test/assert - ((1 2 3 4 5) 3 shorten (1 2 3) ==) assert + ((1 2 3 4 5) 3 shorten (1 2 3) ==) *test/assert - ((1 2 3 4 5) 3 take (1 2 3) ==) assert + ((1 2 3 4 5) 3 take (1 2 3) ==) *test/assert - ((1 2 3 4 5) 6 take (1 2 3 4 5) ==) assert + ((1 2 3 4 5) 6 take (1 2 3 4 5) ==) *test/assert - ((1 2 3 4 5) 3 drop (4 5) ==) assert + ((1 2 3 4 5) 3 drop (4 5) ==) *test/assert - ((1 2 3 4 5) 6 drop () ==) assert + ((1 2 3 4 5) 6 drop () ==) *test/assert - ((1 2 3 4 5) (2 >) find 2 ==) assert + ((1 2 3 4 5) (2 >) find 2 ==) *test/assert - ((1 2 3 4 5) 1 (*) reduce 120 ==) assert + ((1 2 3 4 5) 1 (*) reduce 120 ==) *test/assert - ((1 3 5) (dup *) (+) map-reduce 35 ==) assert + ((1 3 5) (dup *) (+) map-reduce 35 ==) *test/assert - ((1 2 3 4 5 6) (odd?) partition get-stack ((1 3 5) (2 4 6)) ==) assert + ((1 2 3 4 5 6) (odd?) partition get-stack ((1 3 5) (2 4 6)) ==) *test/assert - ((1 2 3 4 5 6) (odd?) reject (2 4 6) ==) assert + ((1 2 3 4 5 6) (odd?) reject (2 4 6) ==) *test/assert - ((1 2 3 4 5 6) 2 4 slice (3 4 5) ==) assert + ((1 2 3 4 5 6) 2 4 slice (3 4 5) ==) *test/assert - ((2 3 () 4 (3 4) () () "test") harvest (2 3 4 (3 4) "test") ==) assert + ((2 3 () 4 (3 4) () () "test") harvest (2 3 4 (3 4) "test") ==) *test/assert - ((1 2 3 (4 5 6) 7 (8 9)) flatten (1 2 3 4 5 6 7 8 9) ==) assert + ((1 2 3 (4 5 6) 7 (8 9)) flatten (1 2 3 4 5 6 7 8 9) ==) *test/assert - ((2 3 + 4 *) quote-map ('+ ==) find 2 ==) assert + ((2 3 + 4 *) quote-map ('+ ==) find 2 ==) *test/assert - ((2 4 6 8) 'even? all?) assert + ((2 4 6 8) 'even? all?) *test/assert - ((2 4 3 6 8) 'even? all? not) assert + ((2 4 3 6 8) 'even? all? not) *test/assert - ((1 2 3 4) 'odd? one? not) assert + ((1 2 3 4) 'odd? one? not) *test/assert - ((1 2 4) 'odd? one?) assert + ((1 2 4) 'odd? one?) *test/assert - ((1 2 3 4) 'odd? any?) assert + ((1 2 3 4) 'odd? any?) *test/assert - ((2 4 6 8) 'odd? any? not) assert + ((2 4 6 8) 'odd? any? not) *test/assert - ((1 2 "test") ("test" "a" true 1) intersection (1 "test") ==) assert + ((1 2 "test") ("test" "a" true 1) intersection (1 "test") ==) *test/assert - ((1 2 "test") ("test" "a" true 1) union (true 1 "test" "a" 2) ==) assert + ((1 2 "test") ("test" "a" true 1) union (true 1 "test" "a" 2) ==) *test/assert - ((1 2 "test") ("test" "a" true 1) difference (2) ==) assert + ((1 2 "test") ("test" "a" true 1) difference (2) ==) *test/assert - ((1 2 "test") ("test" "a" true 1) symmetric-difference (true "a" 2) ==) assert + ((1 2 "test") ("test" "a" true 1) symmetric-difference (true "a" 2) ==) *test/assert - report - clear-stack + *test/report + clear-stack
@@ -1,37 +1,37 @@
-'test load -'test import +'test require :test +;;; -"stack" describe +"stack" *test/describe - (1 2 3 4 get-stack (1 2 3 4) ==) assert + (1 2 3 4 get-stack (1 2 3 4) ==) *test/assert - ((1 2 3) set-stack get-stack (1 2 3) ==) assert + ((1 2 3) set-stack get-stack (1 2 3) ==) *test/assert - (1 id 1 ==) assert + (1 id 1 ==) *test/assert - (2 pop get-stack () ==) assert + (2 pop get-stack () ==) *test/assert - (1 dup get-stack (1 1) ==) assert + (1 dup get-stack (1 1) ==) *test/assert - (3 2 (1 +) dip + 6 ==) assert + (3 2 (1 +) dip + 6 ==) *test/assert - (1 2 nip get-stack (2) ==) assert + (1 2 nip get-stack (2) ==) *test/assert - (1 2 4 '+ dip get-stack (3 4) ==) assert + (1 2 4 '+ dip get-stack (3 4) ==) *test/assert - (1 2 4 '+ keep get-stack (1 6 4) ==) assert + (1 2 4 '+ keep get-stack (1 6 4) ==) *test/assert - ((1) (2 swap append) sip concat (1 2 1) ==) assert + ((1) (2 swap append) sip concat (1 2 1) ==) *test/assert - (1 (2 3) cons (1 2 3) ==) assert + (1 (2 3) cons (1 2 3) ==) *test/assert - (1 2 over get-stack (1 2 1) ==) assert + (1 2 over get-stack (1 2 1) ==) *test/assert - (1 2 3 pick get-stack (1 2 3 1) ==) assert + (1 2 3 pick get-stack (1 2 3 1) ==) *test/assert - ((1 2 3) ('sum 'size) => cleave / 2 ==) assert + ((1 2 3) ('sum 'size) => cleave / 2 ==) *test/assert - ((1 2) (3 4) ((0 get) (1 get)) spread get-stack (1 4) ==) assert + ((1 2) (3 4) ((0 get) (1 get)) spread get-stack (1 4) ==) *test/assert - report - clear-stack + *test/report + clear-stack
@@ -1,85 +1,85 @@
-'test load -'test import +'test require :test +;;; -"str" describe +"str" *test/describe - ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) assert + ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) *test/assert - ("$1 + $2 = $3" (2 2 (2 2 +)) apply interpolate "2 + 2 = 4" ==) assert + ("$1 + $2 = $3" (2 2 (2 2 +)) apply interpolate "2 + 2 = 4" ==) *test/assert - (" test " strip "test" ==) assert + (" test " strip "test" ==) *test/assert - ("test" length 4 ==) assert + ("test" length 4 ==) *test/assert - ("a,b,c" "," split ("a" "b" "c") ==) assert + ("a,b,c" "," split ("a" "b" "c") ==) *test/assert - ("abc" "" split ("a" "b" "c") ==) assert + ("abc" "" split ("a" "b" "c") ==) *test/assert - ("This is a test" 5 2 substr "is" ==) assert + ("This is a test" 5 2 substr "is" ==) *test/assert - ("this" 2 3 substr "is" ==) assert + ("this" 2 3 substr "is" ==) *test/assert - ("This is a test" "is" indexof 2 ==) assert + ("This is a test" "is" indexof 2 ==) *test/assert - ("test #1" "[0-9]" search ("1") ==) assert + ("test #1" "[0-9]" search ("1") ==) *test/assert - ("a" ord 97 ==) assert + ("a" ord 97 ==) *test/assert - (97 chr "a" ==) assert + (97 chr "a" ==) *test/assert - ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) assert + ("This is test #1" "test #([0-9])" search ("test #1" "1") ==) *test/assert - ("This is a random string" "random" match true ==) assert + ("This is a random string" "random" match true ==) *test/assert - ("something is not something else" "some" "any" replace "anything is not anything else" ==) assert + ("something is not something else" "some" "any" replace "anything is not anything else" ==) *test/assert - ("MiN is a concatenative programming language" "/^min/i" =~ ("MiN") ==) assert + ("MiN is a concatenative programming language" "/^min/i" =~ ("MiN") ==) *test/assert - ("This is a difficult test" "s/difficult/simple/" =~ ("This is a simple test") ==) assert + ("This is a difficult test" "s/difficult/simple/" =~ ("This is a simple test") ==) *test/assert - ("This is a DIFFICULT\n test" "s/difficult/simple/mis" =~ ("This is a simple\n test") ==) assert + ("This is a DIFFICULT\n test" "s/difficult/simple/mis" =~ ("This is a simple\n test") ==) *test/assert - ("/api/items/test-1" "/\\/api\\/items\\/(.+)/" regex 1 get "test-1" ==) assert + ("/api/items/test-1" "/\\/api\\/items\\/(.+)/" regex 1 get "test-1" ==) *test/assert - ("this is a test" uppercase "THIS IS A TEST" ==) assert + ("this is a test" uppercase "THIS IS A TEST" ==) *test/assert - ("THIS IS A TEST" lowercase "this is a test" ==) assert + ("THIS IS A TEST" lowercase "this is a test" ==) *test/assert - ("test" capitalize "Test" ==) assert + ("test" capitalize "Test" ==) *test/assert - ("this is a test" titleize "This Is A Test" ==) assert + ("this is a test" titleize "This Is A Test" ==) *test/assert - ("+" 3 repeat "+++" ==) assert + ("+" 3 repeat "+++" ==) *test/assert - ("test" 4 indent " test" ==) assert + ("test" 4 indent " test" ==) *test/assert - ((1 3 "test") ", " join "1, 3, test" ==) assert + ((1 3 "test") ", " join "1, 3, test" ==) *test/assert - ("PWD: $pwd" ("pwd" .) =% ("PWD: " .) => "" join ==) assert + ("PWD: $pwd" ("pwd" .) =% ("PWD: " .) => "" join ==) *test/assert - ("1.2.3" from-semver {1 :major 2 :minor 3 :patch} ==) assert + ("1.2.3" from-semver {1 :major 2 :minor 3 :patch} ==) *test/assert - ({2 :major 25 :minor 300 :patch} to-semver "2.25.300" ==) assert + ({2 :major 25 :minor 300 :patch} to-semver "2.25.300" ==) *test/assert - ("2.3.6" semver-inc-major "3.0.0" ==) assert + ("2.3.6" semver-inc-major "3.0.0" ==) *test/assert - ("2.3.6" semver-inc-minor "2.4.0" ==) assert + ("2.3.6" semver-inc-minor "2.4.0" ==) *test/assert - ("2.3.6" semver-inc-patch "2.3.7" ==) assert + ("2.3.6" semver-inc-patch "2.3.7" ==) *test/assert - ("4.6.5" semver? true ==) assert + ("4.6.5" semver? true ==) *test/assert - ("4.6.5.3" semver? false ==) assert + ("4.6.5.3" semver? false ==) *test/assert - ("fix" "pre" prefix "prefix" ==) assert + ("fix" "pre" prefix "prefix" ==) *test/assert - ("suf" "fix" suffix "suffix" ==) assert + ("suf" "fix" suffix "suffix" ==) *test/assert - ("http://test.com?€%,,!{}" encode-url "http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" ==) assert + ("http://test.com?€%,,!{}" encode-url "http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" ==) *test/assert - ("http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" decode-url "http://test.com?€%,,!{}" ==) assert + ("http%3A%2F%2Ftest.com%3F%E2%82%AC%25%2C%2C%21%7B%7D" decode-url "http://test.com?€%,,!{}" ==) *test/assert - ("http://h3rald.com/a/b/c?test=1#123" parse-url {"123" :anchor "h3rald.com" :hostname "" :password "/a/b/c" :path "" :port "test=1" :query "http" :scheme "" :username} ==) assert + ("http://h3rald.com/a/b/c?test=1#123" parse-url {"123" :anchor "h3rald.com" :hostname "" :password "/a/b/c" :path "" :port "test=1" :query "http" :scheme "" :username} ==) *test/assert - report - clear-stack + *test/report + clear-stack
@@ -1,74 +1,74 @@
-'test load -'test import +'test require :test +;;; -"sys" describe +"sys" *test/describe - ("dir1" mkdir "dir1" dir?) assert + ("dir1" mkdir "dir1" dir?) *test/assert - ("dir1" "dir2" mv "dir2" dir?) assert + ("dir1" "dir2" mv "dir2" dir?) *test/assert - ("dir1" dir? false ==) assert + ("dir1" dir? false ==) *test/assert - ("dir2" "dir1" cp "dir1" dir?) assert + ("dir2" "dir1" cp "dir1" dir?) *test/assert - ("..." "dir1/test.txt" fwrite "dir1/test.txt" file?) assert + ("..." "dir1/test.txt" fwrite "dir1/test.txt" file?) *test/assert - ("dir1/test.txt" "dir2" mv "dir2/test.txt" file?) assert + ("dir1/test.txt" "dir2" mv "dir2/test.txt" file?) *test/assert - ("dir1/test.txt" file? false ==) assert + ("dir1/test.txt" file? false ==) *test/assert - ("dir2/test.txt" "dir1" cp "dir1/test.txt" file?) assert + ("dir2/test.txt" "dir1" cp "dir1/test.txt" file?) *test/assert - ('dir1 ls 'filename map ("test.txt") ==) assert + ('dir1 ls 'filename map ("test.txt") ==) *test/assert - ('dir2 ls 'dirname map ("dir2") ==) assert + ('dir2 ls 'dirname map ("dir2") ==) *test/assert - ('dir1 rmdir 'dir2 rmdir 'dir1 dir? 'dir2 dir? or false ==) assert + ('dir1 rmdir 'dir2 rmdir 'dir1 dir? 'dir2 dir? or false ==) *test/assert - ("systest" mkdir . ls (. "systest") => "/" join in?) assert + ("systest" mkdir . ls (. "systest") => "/" join in?) *test/assert - ("systest" cd . "systest" match) assert + ("systest" cd . "systest" match) *test/assert .. cd - ("./min -v" & 'output dget "\." match) assert + ("./min -v" & 'output dget "\." match) *test/assert - ("PATH" env?) assert + ("PATH" env?) *test/assert - ($PATH length 0 >) assert + ($PATH length 0 >) *test/assert - ("TEST" "AAA" put-env $AAA "TEST" ==) assert + ("TEST" "AAA" put-env $AAA "TEST" ==) *test/assert - (os length 0 >) assert + (os length 0 >) *test/assert - (cpu length 0 >) assert + (cpu length 0 >) *test/assert - ("TEST" "test.txt" fwrite "test.txt" file?) assert + ("TEST" "test.txt" fwrite "test.txt" file?) *test/assert - ("systest" exists?) assert + ("systest" exists?) *test/assert - ("systest" dir?) assert + ("systest" dir?) *test/assert - ("test.txt" "test2.txt" cp "test2.txt" file?) assert + ("test.txt" "test2.txt" cp "test2.txt" file?) *test/assert - ("test.txt" "test1.txt" mv "test1.txt" file?) assert + ("test.txt" "test1.txt" mv "test1.txt" file?) *test/assert - ("test2.txt" rm "test1.txt" rm . ls (. "test1.txt") => "/" join in? :t1 . ls "test2" in? t1 and false ==) assert + ("test2.txt" rm "test1.txt" rm . ls (. "test1.txt") => "/" join in? :t1 . ls "test2" in? t1 and false ==) *test/assert ("systest" cd "TEST" "test.txt" fwrite "TEST1" "test1.txt" fwrite "TEST2" "test2.txt" fwrite "TEST3" "test3.txt" fwrite - . ls "test.zip" zip . ls (. "test.zip") => "/" join in?) assert + . ls "test.zip" zip . ls (. "test.zip") => "/" join in?) *test/assert - ("test.zip" "extracted" unzip "extracted" ls "extracted/test1.txt" in?) assert + ("test.zip" "extracted" unzip "extracted" ls "extracted/test1.txt" in?) *test/assert .. cd - ("systest" rmdir . ls (. "systest") => "/" join in? false ==) assert + ("systest" rmdir . ls (. "systest") => "/" join in? false ==) *test/assert - report + *test/report clear-stack - "systest" rmdir + "systest" rmdir
@@ -1,64 +1,61 @@
;; test module -{ - 'OK :ok +"." :ok - (" " print!) :padding +(" " print!) :padding - ;; describe - ( - :name - "Testing: [" print! name print! "]" puts! - padding - () - ) :describe +;; *test/describe +( + :name + "Testing: [" print! name print! "]" puts! + padding + () +) :describe - ;; assert +;; *test/assert +( + ' :check ; save the check quotation to validate + ' :results ; save the result symbol to update ( - ' :check ; save the check quotation to validate - ' :results ; save the result symbol to update - ( - ( - (check -> true ==) - (format-error puts! false) - ) try - - ) - ( - ok results append quote @results - "." print! - ) - ( - check results append quote @results - "x" print! - ) - if - results - ) :assert + ( + (check -> true ==) + (format-error puts! false) + ) try + + ) + ( + ok results append quote @results + "." print! + ) + ( + check results append quote @results + "x" print! + ) + if + results +) :assert - ;; report +;; *test/report +( + newline + ' :results ; save the results collected so far + 0 :total + 0 :failed + results ( + total succ @total + (ok !=) (failed succ @failed) () if + ) map + "$# tests executed - $# failed." (total failed) =% puts! ( - newline - ' :results ; save the results collected so far - 0 :total - 0 :failed - results ( - total succ @total - (ok !=) (failed succ @failed) () if - ) map - padding total print! " tests executed - " print! failed print! " failed." puts! - ( - =result - result - (ok !=) - ( - ('failures defined?) (failures succ @failures) () if - padding "FAILED: " print! result puts! - ) - () - if - ) - map - pop ;Remove results accomulator from get-stack - ) :report - -} +test + =result + result + (ok !=) + ( + ('failures defined-symbol?) (failures succ @failures) () if + padding "FAILED: " print! result puts! + ) + () + if + ) + map + pop ;Remove results accomulator from get-stack +) :report
@@ -1,21 +1,21 @@
-'test load -'test import +'test require :test +;;; -"time" describe +"time" *test/describe - (timestamp 1464951736 >) assert + (timestamp 1464951736 >) *test/assert - (now 1464951736 >) assert + (now 1464951736 >) *test/assert - (1464951736 datetime "2016-06-03T11:02:16Z" ==) assert + (1464951736 datetime "2016-06-03T11:02:16Z" ==) *test/assert - (1464951736 "yy-MM-dd" tformat "16-06-03" ==) assert + (1464951736 "yy-MM-dd" tformat "16-06-03" ==) *test/assert - (1464951736 timeinfo to-timestamp 1464951736 ==) assert + (1464951736 timeinfo to-timestamp 1464951736 ==) *test/assert - (1464951736 timeinfo 'second dget 16 ==) assert + (1464951736 timeinfo 'second dget 16 ==) *test/assert - (1464951736 timeinfo 'timezone dget integer?) assert + (1464951736 timeinfo 'timezone dget integer?) *test/assert - report - clear-stack + *test/report + clear-stack