You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
48 KiB

{"functions":[{"name":"+ (add)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(+ i1 i2...)","description":"Adds a variable number of integer inputs and returns the result. In the event of an _overflow_, throws a runtime error.","example":"(+ 1 2 3) ;; Returns 6"},{"name":"- (subtract)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(- i1 i2...)","description":"Subtracts a variable number of integer inputs and returns the result. In the event of an _underflow_, throws a runtime error.","example":"(- 2 1 1) ;; Returns 0\n(- 0 3) ;; Returns -3\n"},{"name":"* (multiply)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(* i1 i2...)","description":"Multiplies a variable number of integer inputs and returns the result. In the event of an _overflow_, throws a runtime error.","example":"(* 2 3) ;; Returns 6\n(* 5 2) ;; Returns 10\n(* 2 2 2) ;; Returns 8\n"},{"name":"/ (divide)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(/ i1 i2...)","description":"Integer divides a variable number of integer inputs and returns the result. In the event of division by zero, throws a runtime error.","example":"(/ 2 3) ;; Returns 0\n(/ 5 2) ;; Returns 2\n(/ 4 2 2) ;; Returns 1\n"},{"name":">= (greater than or equal)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(>= i1 i2)","description":"Compares two integers, returning `true` if `i1` is greater than or equal to `i2` and `false` otherwise.","example":"(>= 1 1) ;; Returns true\n(>= 5 2) ;; Returns true\n"},{"name":"<= (less than or equal)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(<= i1 i2)","description":"Compares two integers, returning true if `i1` is less than or equal to `i2` and `false` otherwise.","example":"(<= 1 1) ;; Returns true\n(<= 5 2) ;; Returns false\n"},{"name":"< (less than)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(< i1 i2)","description":"Compares two integers, returning `true` if `i1` is less than `i2` and `false` otherwise.","example":"(< 1 2) ;; Returns true\n(< 5 2) ;; Returns false\n"},{"name":"> (greater than)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(> i1 i2)","description":"Compares two integers, returning `true` if `i1` is greater than `i2` and false otherwise.","example":"(> 1 2) ;; Returns false\n(> 5 2) ;; Returns true\n"},{"name":"to-int","input_type":"uint","output_type":"int","signature":"(to-int u)","description":"Tries to convert the `uint` argument to an `int`. Will cause a runtime error and abort if the supplied argument is >= `pow(2, 127)`","example":"(to-int u238) ;; Returns 238"},{"name":"to-uint","input_type":"int","output_type":"uint","signature":"(to-uint i)","description":"Tries to convert the `int` argument to a `uint`. Will cause a runtime error and abort if the supplied argument is negative.","example":"(to-uint 238) ;; Returns u238"},{"name":"mod","input_type":"int, int | uint, uint","output_type":"int | uint","signature":"(mod i1 i2)","description":"Returns the integer remainder from integer dividing `i1` by `i2`. In the event of a division by zero, throws a runtime error.","example":"(mod 2 3) ;; Returns 0\n(mod 5 2) ;; Returns 1\n(mod 7 1) ;; Returns 0\n"},{"name":"pow","input_type":"int, int | uint, uint","output_type":"int | uint","signature":"(pow i1 i2)","description":"Returns the result of raising `i1` to the power of `i2`. In the event of an _overflow_, throws a runtime error.","example":"(pow 2 3) ;; Returns 8\n(pow 2 2) ;; Returns 4\n(pow 7 1) ;; Returns 7\n"},{"name":"xor","input_type":"int, int | uint, uint","output_type":"int | uint","signature":"(xor i1 i2)","description":"Returns the result of bitwise exclusive or'ing `i1` with `i2`.","example":"(xor 1 2) ;; Returns 3\n(xor 120 280) ;; Returns 352\n"},{"name":"and","input_type":"bool, ...","output_type":"bool","signature":"(and b1 b2 ...)","description":"Returns `true` if all boolean inputs are `true`. Importantly, the supplied arguments are evaluated