diff --git a/docs/README.md b/docs/README.md index 8d7e6d0..d427dee 100644 --- a/docs/README.md +++ b/docs/README.md @@ -41,7 +41,6 @@ Information about Tomo's built-in types can be found here: ### `ask` Gets a line of user input text with a prompt. -**Signature:** ```tomo func ask(prompt:Text, bold:Bool = yes, force_tty:Bool = yes -> Void) ``` @@ -72,7 +71,6 @@ something went wrong (e.g. the user hit `Ctrl-D`). ### `exit` Exits the program with a given status and optionally prints a message. -**Signature:** ```tomo func ask(message:Text? = !Text, status:Int32 = 1[32] -> Void) ``` @@ -95,7 +93,6 @@ exit(status=1, "Goodbye forever!") ### `say` Prints a message to the console. -**Signature:** ```tomo func say(text:Text, newline:Bool = yes -> Void) ``` @@ -117,7 +114,6 @@ say("world!") ### `sleep` Pause execution for a given number of seconds. -**Signature:** ```tomo func sleep(seconds: Num -> Void) ``` @@ -137,7 +133,6 @@ sleep(1.5) ### `fail` Prints a message to the console, aborts the program, and prints a stack trace. -**Signature:** ```tomo func fail(message:Text -> Abort) ``` @@ -157,7 +152,6 @@ fail("Oh no!") ### `now` Gets the current time. This is an alias for `Moment.now()`. -**Signature:** ```tomo func now(->Moment) ``` diff --git a/docs/arrays.md b/docs/arrays.md index 98236c5..543e44e 100644 --- a/docs/arrays.md +++ b/docs/arrays.md @@ -262,7 +262,6 @@ variable or dereference a heap pointer, it may trigger copy-on-write behavior. ### `binary_search` Performs a binary search on a sorted array. -**Signature:** ```tomo func binary_search(arr: [T], by: func(x,y:&T->Int32) = T.compare -> Int) ``` @@ -294,7 +293,6 @@ place where it would be found if it were inserted and the array were sorted. ### `by` Creates a new array with elements spaced by the specified step value. -**Signature:** ```tomo func by(arr: [T], step: Int -> [T]) ``` @@ -316,7 +314,6 @@ A new array with every `step`-th element from the original array. ### `clear` Clears all elements from the array. -**Signature:** ```tomo func clear(arr: @[T] -> Void) ``` @@ -336,7 +333,6 @@ Nothing. ### `counts` Counts the occurrences of each element in the array. -**Signature:** ```tomo func counts(arr: [T] -> {T,Int}) ``` @@ -357,7 +353,6 @@ A table mapping each element to its count. ### `find` Finds the index of the first occurrence of an element (if any). -**Signature:** ```tomo func find(arr: [T], target: T -> Int?) ``` @@ -382,7 +377,6 @@ The index of the first occurrence or `!Int` if not found. ### `first` Find the index of the first item that matches a predicate function (if any). -**Signature:** ```tomo func first(arr: [T], predicate: func(item:&T -> Bool) -> Int) ``` @@ -408,7 +402,6 @@ item matches. ### `from` Returns a slice of the array starting from a specified index. -**Signature:** ```tomo func from(arr: [T], first: Int -> [T]) ``` @@ -430,7 +423,6 @@ A new array starting from the specified index. ### `has` Checks if the array has any elements. -**Signature:** ```tomo func has(arr: [T] -> Bool) ``` @@ -452,7 +444,6 @@ func has(arr: [T] -> Bool) Removes and returns the top element of a heap or `none` if the array is empty. By default, this is the *minimum* value in the heap. -**Signature:** ```tomo func heap_pop(arr: @[T], by: func(x,y:&T->Int32) = T.compare -> T?) ``` @@ -478,7 +469,6 @@ The removed top element of the heap or `none` if the array is empty. Adds an element to the heap and maintains the heap property. By default, this is a *minimum* heap. -**Signature:** ```tomo func heap_push(arr: @[T], item: T, by=T.compare -> Void) ``` @@ -501,7 +491,6 @@ Nothing. ### `heapify` Converts an array into a heap. -**Signature:** ```tomo func heapify(arr: @[T], by: func(x,y:&T->Int32) = T.compare -> Void) ``` @@ -524,7 +513,6 @@ Nothing. ### `insert` Inserts an element at a specified position in the array. -**Signature:** ```tomo func insert(arr: @[T], item: T, at: Int = 0 -> Void) ``` @@ -555,7 +543,6 @@ Nothing. ### `insert_all` Inserts an array of items at a specified position in the array. -**Signature:** ```tomo func insert_all(arr: @[T], items: [T], at: Int = 0 -> Void) ``` @@ -588,7 +575,6 @@ Removes and returns an item from the array. If the given index is present in the array, the item at that index will be removed and the array will become one element shorter. -**Signature:** ```tomo func pop(arr: &[T], index: Int = -1 -> T?) ``` @@ -620,7 +606,6 @@ otherwise the item at the given index. ### `random` Selects a random element from the array. -**Signature:** ```tomo func random(arr: [T], rng: RNG = random -> T) ``` @@ -642,7 +627,6 @@ A random element from the array. ### `remove_at` Removes elements from the array starting at a specified index. -**Signature:** ```tomo func remove_at(arr: @[T], at: Int = -1, count: Int = 1 -> Void) ``` @@ -671,7 +655,6 @@ arr:remove_at(2, count=2) ### `remove_item` Removes all occurrences of a specified item from the array. -**Signature:** ```tomo func remove_item(arr: @[T], item: T, max_count: Int = -1 -> Void) ``` @@ -700,7 +683,6 @@ arr:remove_item(20, max_count=1) ### `reversed` Returns a reversed slice of the array. -**Signature:** ```tomo func reversed(arr: [T] -> [T]) ``` @@ -722,7 +704,6 @@ A slice of the array with elements in reverse order. Selects a sample of elements from the array, optionally with weighted probabilities. -**Signature:** ```tomo func sample(arr: [T], count: Int, weights: [Num]? = ![Num], rng: RNG = random -> [T]) ``` @@ -757,7 +738,6 @@ A list of sampled elements from the array. ### `shuffle` Shuffles the elements of the array in place. -**Signature:** ```tomo func shuffle(arr: @[T], rng: RNG = random -> Void) ``` @@ -778,7 +758,6 @@ Nothing. ### `shuffled` Creates a new array with elements shuffled. -**Signature:** ```tomo func shuffled(arr: [T], rng: RNG = random -> [T]) ``` @@ -800,7 +779,6 @@ A new array with shuffled elements. ### `slice` Returns a slice of the array spanning the given indices (inclusive). -**Signature:** ```tomo func slice(arr: [T], from: Int, to: Int -> [T]) ``` @@ -828,7 +806,6 @@ second-to-last, and so on. ### `sort` Sorts the elements of the array in place in ascending order (small to large). -**Signature:** ```tomo func sort(arr: @[T], by=T.compare -> Void) ``` @@ -857,7 +834,6 @@ arr:sort(func(a,b:&Int): a:abs() <> b:abs()) ### `sorted` Creates a new array with elements sorted. -**Signature:** ```tomo sorted(arr: [T], by=T.compare -> [T]) ``` @@ -883,7 +859,6 @@ A new array with sorted elements. ### `to` Returns a slice of the array from the start of the original array up to a specified index (inclusive). -**Signature:** ```tomo to(arr: [T], last: Int -> [T]) ``` @@ -908,7 +883,6 @@ A new array containing elements from the start up to the specified index. ### `unique` Returns a Set that contains the unique elements of the array. -**Signature:** ```tomo unique(arr: [T] -> {T}) ``` diff --git a/docs/booleans.md b/docs/booleans.md index c14e003..8961091 100644 --- a/docs/booleans.md +++ b/docs/booleans.md @@ -14,7 +14,6 @@ Converts a string representation of a boolean value into a boolean. Acceptable boolean values are case-insensitive variations of `yes`/`no`, `y`/`n`, `true`/`false`, `on`/`off`. -**Signature:** ```tomo func parse(text: Text -> Bool?) ``` diff --git a/docs/integers.md b/docs/integers.md index 7439a9c..d4e2fc3 100644 --- a/docs/integers.md +++ b/docs/integers.md @@ -140,7 +140,6 @@ can be called either on the type itself: `Int.sqrt(x)` or as a method call: ### `abs` Calculates the absolute value of an integer. -**Signature:** ```tomo func abs(x: Int -> Int) ``` @@ -163,7 +162,6 @@ Computes the binomial coefficient of the given numbers (the equivalent of `n` choose `k` in combinatorics). This is equal to `n:factorial()/(k:factorial() * (n-k):factorial())`. -**Signature:** ```tomo func choose(n: Int, k: Int -> Int) ``` @@ -187,7 +185,6 @@ The binomial coefficient, equivalent to the number of ways to uniquely choose Returns the given number clamped between two values so that it is within that range. -**Signature:** ```tomo func clamped(x, low, high: Int -> Int) ``` @@ -210,7 +207,6 @@ The first argument clamped between the other two arguments. ### `factorial` Computes the factorial of an integer. -**Signature:** ```tomo func factorial(n: Int -> Text) ``` @@ -231,7 +227,6 @@ The factorial of the given integer. ### `format` Formats an integer as a string with a specified number of digits. -**Signature:** ```tomo func format(i: Int, digits: Int = 0 -> Text) ``` @@ -253,7 +248,6 @@ A string representation of the integer, padded to the specified number of digits ### `hex` Converts an integer to its hexadecimal representation. -**Signature:** ```tomo func hex(i: Int, digits: Int = 0, uppercase: Bool = yes, prefix: Bool = yes -> Text) ``` @@ -283,7 +277,6 @@ getting an incorrect answer are astronomically small (on the order of 10^(-30)). See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index-mpz_005fprobab_005fprime_005fp) for more details. -**Signature:** ```tomo func is_prime(x: Int, reps: Int = 50 -> Bool) ``` @@ -313,7 +306,6 @@ answer are astronomically small (on the order of 10^(-30)). See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index-mpz_005fprobab_005fprime_005fp) for more details. -**Signature:** ```tomo func next_prime(x: Int -> Int) ``` @@ -334,7 +326,6 @@ The next prime number greater than `x`. ### `octal` Converts an integer to its octal representation. -**Signature:** ```tomo func octal(i: Int, digits: Int = 0, prefix: Bool = yes -> Text) ``` @@ -358,7 +349,6 @@ The octal string representation of the integer. Return an iterator that counts infinitely from the starting integer (with an optional step size). -**Signature:** ```tomo func onward(first: Int, step: Int = 1 -> Text) ``` @@ -384,7 +374,6 @@ for i in 5:onward(): ### `parse` Converts a text representation of an integer into an integer. -**Signature:** ```tomo func parse(text: Text -> Int?) ``` @@ -425,7 +414,6 @@ answer are astronomically small (on the order of 10^(-30)). See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index-mpz_005fprobab_005fprime_005fp) for more details. -**Signature:** ```tomo func prev_prime(x: Int -> Int) ``` @@ -444,9 +432,8 @@ The previous prime number less than `x`. --- ### `sqrt` -Calculates the square root of an integer. +Calculates the square root of an integer. -**Signature:** ```tomo func sqrt(x: Int -> Int) ``` @@ -468,9 +455,8 @@ The integer part of the square root of `x`. ### `to` Returns an iterator function that iterates over the range of numbers specified. -Iteration is assumed to be nonempty and +Iteration is assumed to be nonempty and -**Signature:** ```tomo func to(first: Int, last: Int, step : Int? = none:Int -> func(->Int?)) ``` diff --git a/docs/moments.md b/docs/moments.md index c827412..5a10f10 100644 --- a/docs/moments.md +++ b/docs/moments.md @@ -100,7 +100,6 @@ affected by leap seconds. For this reason, `after()` takes an argument, `timezone` which is used to determine in which timezone the offsets should be calculated. -**Signature:** ```tomo func after(moment: Moment, seconds : Num = 0.0, minutes : Num = 0.0, hours : Num = 0.0, days : Int = 0, weeks : Int = 0, months : Int = 0, years : Int = 0, timezone : Text? = !Text -> Moment) ``` @@ -131,7 +130,6 @@ A new `Moment` offset by the given amount. Return a text representation of the moment using the `"%F"` format specifier, which gives the date in `YYYY-MM-DD` form. -**Signature:** ```tomo func date(moment: Moment, timezone : Text? = !Text -> Text) ``` @@ -153,7 +151,6 @@ The date in `YYYY-MM-DD` format. ### `day_of_month` Return the integer day of the month (1-31). -**Signature:** ```tomo func day_of_month(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -176,7 +173,6 @@ The day of the month as an integer (1-31). Return the integer day of the week (1-7), where 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday. -**Signature:** ```tomo func day_of_week(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -198,7 +194,6 @@ The day of the week as an integer (1-7). ### `day_of_year` Return the integer day of the year (1-366, including leap years). -**Signature:** ```tomo func day_of_year(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -223,7 +218,6 @@ options, return a text representation of the given date in the given format. If `timezone` is specified, use that timezone instead of the current local timezone. -**Signature:** ```tomo func format(moment: Moment, format: Text = "%Y-%m-%dT%H:%M:%S%z", timezone : Text? = !Text -> Text) ``` @@ -247,7 +241,6 @@ Nothing. Return a moment object that represents the same moment in time as the given UNIX epoch timestamp (seconds since January 1, 1970 UTC). -**Signature:** ```tomo func from_unix_timestamp(timestamp: Int64 -> Moment) ``` @@ -269,7 +262,6 @@ Get the local timezone's name (e.g. `America/New_York` or `UTC`. By default, this value is read from `/etc/localtime`, however, this can be overridden by calling `Moment.set_local_timezone(...)`. -**Signature:** ```tomo func get_local_timezone(->Text) ``` @@ -290,7 +282,6 @@ The name of the current local timezone. ### `hour` Return the hour of the day as an integer (1-24). -**Signature:** ```tomo func hour(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -312,7 +303,6 @@ The hour of the day as an integer (1-24). ### `hours_till` Return the number of hours until a given moment. -**Signature:** ```tomo func hours_till(moment: Moment, then:Moment -> Num) ``` @@ -335,7 +325,6 @@ the_future := now():after(hours=1, minutes=30) ### `minute` Return the minute of the day as an integer (0-59). -**Signature:** ```tomo func minute(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -357,7 +346,6 @@ The minute of the hour as an integer (0-59). ### `minutes_till` Return the number of minutes until a given moment. -**Signature:** ```tomo func minutes_till(moment: Moment, then:Moment -> Num) ``` @@ -380,7 +368,6 @@ the_future := now():after(minutes=1, seconds=30) ### `month` Return the month of the year as an integer (1-12). -**Signature:** ```tomo func month(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -402,7 +389,6 @@ The month of the year as an integer (1-12). ### `nanosecond` Return the nanosecond of the second as an integer (0-999,999,999). -**Signature:** ```tomo func nanosecond(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -426,7 +412,6 @@ Return a new `Moment` object representing the given time parameters expressed in local time. This function is the same as calling `Moment` directly as a constructor. -**Signature:** ```tomo func new(year : Int, month : Int, day : Int, hour : Int = 0, minute : Int = 0, second : Num = 0.0 -> Moment) ``` @@ -461,7 +446,6 @@ integer, an error will be raised. Get a `Moment` object representing the current date and time. This function is the same as the global function `now()`. -**Signature:** ```tomo func now(->Moment) ``` @@ -483,7 +467,6 @@ Returns a `Moment` object representing the current date and time. Return a new `Moment` object parsed from the given string in the given format, or `none` if the value could not be successfully parsed. -**Signature:** ```tomo func parse(text: Text, format: Text = "%Y-%m-%dT%H:%M:%S%z" -> Moment?) ``` @@ -512,7 +495,6 @@ If the text was successfully parsed according to the given format, return a Return a plain English textual representation of the approximate time difference between two `Moment`s. For example: `5 minutes ago` or `1 day later` -**Signature:** ```tomo func relative(moment: Moment, relative_to : Moment = Moment.now(), timezone : Text? = !Text -> Text) ``` @@ -544,7 +526,6 @@ ago"`, while moments in the future will have the suffix `" later"`. ### `second` Return the second of the minute as an integer (0-59). -**Signature:** ```tomo func second(moment: Moment, timezone : Text? = !Text -> Int) ``` @@ -566,7 +547,6 @@ The second of the hour as an integer (0-59). ### `seconds_till` Return the number of seconds until a given moment. -**Signature:** ```tomo func seconds_till(moment: Moment, then:Moment -> Num) ``` @@ -593,7 +573,6 @@ timezone for performing calculations and constructing `Moment` objects from component parts. It's also used as the default way that `Moment` objects are converted to text. -**Signature:** ```tomo func set_local_timezone(timezone : Text? = !Text -> Void) ``` @@ -615,7 +594,6 @@ Moment.set_local_timezone("America/Los_Angeles") ### `time` Return a text representation of the time component of the given moment. -**Signature:** ```tomo func time(moment: Moment, seconds : Bool = no, am_pm : Bool = yes, timezone : Text? = !Text -> Text) ``` @@ -648,7 +626,6 @@ moment := Moment(2024, 9, 29, hours=13, minutes=59, seconds=30) Get the UNIX timestamp of the given moment (seconds since the UNIX epoch: January 1, 1970 UTC). -**Signature:** ```tomo func unix_timestamp(moment:Moment->Int64) ``` diff --git a/docs/nums.md b/docs/nums.md index 4bfe1fe..7a86a58 100644 --- a/docs/nums.md +++ b/docs/nums.md @@ -172,7 +172,6 @@ called either on the type itself: `Num.sqrt(x)` or as a method call: ### `abs` Calculates the absolute value of a number. -**Signature:** ```tomo func abs(n: Num -> Num) ``` @@ -193,7 +192,6 @@ The absolute value of `n`. ### `acos` Computes the arc cosine of a number. -**Signature:** ```tomo func acos(x: Num -> Num) ``` @@ -214,7 +212,6 @@ The arc cosine of `x` in radians. ### `acosh` Computes the inverse hyperbolic cosine of a number. -**Signature:** ```tomo func acosh(x: Num -> Num) ``` @@ -235,7 +232,6 @@ The inverse hyperbolic cosine of `x`. ### `asin` Computes the arc sine of a number. -**Signature:** ```tomo func asin(x: Num -> Num) ``` @@ -256,7 +252,6 @@ The arc sine of `x` in radians. ### `asinh` Computes the inverse hyperbolic sine of a number. -**Signature:** ```tomo func asinh(x: Num -> Num) ``` @@ -277,7 +272,6 @@ The inverse hyperbolic sine of `x`. ### `atan` Computes the arc tangent of a number. -**Signature:** ```tomo func atan(x: Num -> Num) ``` @@ -298,7 +292,6 @@ The arc tangent of `x` in radians. ### `atan2` Computes the arc tangent of the quotient of two numbers. -**Signature:** ```tomo func atan2(x: Num, y: Num -> Num) ``` @@ -320,7 +313,6 @@ The arc tangent of `x/y` in radians. ### `atanh` Computes the inverse hyperbolic tangent of a number. -**Signature:** ```tomo func atanh(x: Num -> Num) ``` @@ -341,7 +333,6 @@ The inverse hyperbolic tangent of `x`. ### `cbrt` Computes the cube root of a number. -**Signature:** ```tomo func cbrt(x: Num -> Num) ``` @@ -362,7 +353,6 @@ The cube root of `x`. ### `ceil` Rounds a number up to the nearest integer. -**Signature:** ```tomo func ceil(x: Num -> Num) ``` @@ -384,7 +374,6 @@ The smallest integer greater than or equal to `x`. Returns the given number clamped between two values so that it is within that range. -**Signature:** ```tomo clamped(x, low, high: Num -> Num) ``` @@ -407,7 +396,6 @@ The first argument clamped between the other two arguments. ### `copysign` Copies the sign of one number to another. -**Signature:** ```tomo func copysign(x: Num, y: Num -> Num) ``` @@ -429,7 +417,6 @@ A number with the magnitude of `x` and the sign of `y`. ### `cos` Computes the cosine of a number (angle in radians). -**Signature:** ```tomo func cos(x: Num -> Num) ``` @@ -450,7 +437,6 @@ The cosine of `x`. ### `cosh` Computes the hyperbolic cosine of a number. -**Signature:** ```tomo func cosh(x: Num -> Num) ``` @@ -471,7 +457,6 @@ The hyperbolic cosine of `x`. ### `erf` Computes the error function of a number. -**Signature:** ```tomo func erf(x: Num -> Num) ``` @@ -492,7 +477,6 @@ The error function of `x`. ### `erfc` Computes the complementary error function of a number. -**Signature:** ```tomo func erfc(x: Num -> Num) ``` @@ -513,7 +497,6 @@ The complementary error function of `x`. ### `exp` Computes the exponential function \( e^x \) for a number. -**Signature:** ```tomo func exp(x: Num -> Num) ``` @@ -534,7 +517,6 @@ The value of \( e^x \). ### `exp2` Computes \( 2^x \) for a number. -**Signature:** ```tomo func exp2(x: Num -> Num) ``` @@ -555,7 +537,6 @@ The value of \( 2^x \). ### `expm1` Computes \( e^x - 1 \) for a number. -**Signature:** ```tomo func expm1(x: Num -> Num) ``` @@ -576,7 +557,6 @@ The value of \( e^x - 1 \). ### `fdim` Computes the positive difference between two numbers. -**Signature:** ```tomo func fdim(x: Num, y: Num -> Num) ``` @@ -600,7 +580,6 @@ fd ### `floor` Rounds a number down to the nearest integer. -**Signature:** ```tomo func floor(x: Num -> Num) ``` @@ -621,7 +600,6 @@ The largest integer less than or equal to `x`. ### `format` Formats a number as a text with a specified precision. -**Signature:** ```tomo func format(n: Num, precision: Int = 0 -> Text) ``` @@ -643,7 +621,6 @@ A text representation of the number with the specified precision. ### `hypot` Computes the Euclidean norm, \( \sqrt{x^2 + y^2} \), of two numbers. -**Signature:** ```tomo func hypot(x: Num, y: Num -> Num) ``` @@ -665,7 +642,6 @@ The Euclidean norm of `x` and `y`. ### `isfinite` Checks if a number is finite. -**Signature:** ```tomo func isfinite(n: Num -> Bool) ``` @@ -688,7 +664,6 @@ func isfinite(n: Num -> Bool) ### `isinf` Checks if a number is infinite. -**Signature:** ```tomo func isinf(n: Num -> Bool) ``` @@ -711,7 +686,6 @@ func isinf(n: Num -> Bool) ### `j0` Computes the Bessel function of the first kind of order 0. -**Signature:** ```tomo func j0(x: Num -> Num) ``` @@ -732,7 +706,6 @@ The Bessel function of the first kind of order 0 of `x`. ### `j1` Computes the Bessel function of the first kind of order 1. -**Signature:** ```tomo func j1(x: Num -> Num) ``` @@ -753,7 +726,6 @@ The Bessel function of the first kind of order 1 of `x`. ### `log` Computes the natural logarithm (base \( e \)) of a number. -**Signature:** ```tomo func log(x: Num -> Num) ``` @@ -774,7 +746,6 @@ The natural logarithm of `x`. ### `log10` Computes the base-10 logarithm of a number. -**Signature:** ```tomo func log10(x: Num -> Num) ``` @@ -795,7 +766,6 @@ The base-10 logarithm of `x`. ### `log1p` Computes \( \log(1 + x) \) for a number. -**Signature:** ```tomo func log1p(x: Num -> Num) ``` @@ -816,7 +786,6 @@ The value of \( \log(1 + x) \). ### `log2` Computes the base-2 logarithm of a number. -**Signature:** ```tomo func log2(x: Num -> Num) ``` @@ -837,7 +806,6 @@ The base-2 logarithm of `x`. ### `logb` Computes the binary exponent (base-2 logarithm) of a number. -**Signature:** ```tomo func logb(x: Num -> Num) ``` @@ -858,7 +826,6 @@ The binary exponent of `x`. ### `mix` Interpolates between two numbers based on a given amount. -**Signature:** ```tomo func mix(amount: Num, x: Num, y: Num -> Num) ``` @@ -885,7 +852,6 @@ Checks if two numbers are approximately equal within specified tolerances. If two numbers are within an absolute difference or the ratio between the two is small enough, they are considered near each other. -**Signature:** ```tomo func near(x: Num, y: Num, ratio: Num = 1e-9, min_epsilon: Num = 1e-9 -> Bool) ``` @@ -915,7 +881,6 @@ func near(x: Num, y: Num, ratio: Num = 1e-9, min_epsilon: Num = 1e-9 -> Bool) ### `nextafter` Computes the next representable value after a given number towards a specified direction. -**Signature:** ```tomo func nextafter(x: Num, y: Num -> Num) ``` @@ -937,7 +902,6 @@ The next representable value after `x` in the direction of `y`. ### `parse` Converts a text representation of a number into a floating-point number. -**Signature:** ```tomo func parse(text: Text -> Num?) ``` @@ -961,7 +925,6 @@ as a number. ### `rint` Rounds a number to the nearest integer, with ties rounded to the nearest even integer. -**Signature:** ```tomo func rint(x: Num -> Num) ``` @@ -984,7 +947,6 @@ The nearest integer value of `x`. ### `round` Rounds a number to the nearest whole number integer. -**Signature:** ```tomo func round(x: Num -> Num) ``` @@ -1007,7 +969,6 @@ The nearest integer value of `x`. ### `scientific` Formats a number in scientific notation with a specified precision. -**Signature:** ```tomo func scientific(n: Num, precision: Int = 0 -> Text) ``` @@ -1029,7 +990,6 @@ A text representation of the number in scientific notation with the specified pr ### `significand` Extracts the significand (or mantissa) of a number. -**Signature:** ```tomo func significand(x: Num -> Num) ``` @@ -1050,7 +1010,6 @@ The significand of `x`. ### `sin` Computes the sine of a number (angle in radians). -**Signature:** ```tomo func sin(x: Num -> Num) ``` @@ -1071,7 +1030,6 @@ The sine of `x`. ### `sinh` Computes the hyperbolic sine of a number. -**Signature:** ```tomo func sinh(x: Num -> Num) ``` @@ -1092,7 +1050,6 @@ The hyperbolic sine of `x`. ### `sqrt` Computes the square root of a number. -**Signature:** ```tomo func sqrt(x: Num -> Num) ``` @@ -1113,7 +1070,6 @@ The square root of `x`. ### `tan` Computes the tangent of a number (angle in radians). -**Signature:** ```tomo func tan(x: Num -> Num) ``` @@ -1134,7 +1090,6 @@ The tangent of `x`. ### `tanh` Computes the hyperbolic tangent of a number. -**Signature:** ```tomo func tanh(x: Num -> Num) ``` @@ -1155,7 +1110,6 @@ The hyperbolic tangent of `x`. ### `tgamma` Computes the gamma function of a number. -**Signature:** ```tomo func tgamma(x: Num -> Num) ``` @@ -1176,7 +1130,6 @@ The gamma function of `x`. ### `trunc` Truncates a number to the nearest integer towards zero. -**Signature:** ```tomo func trunc(x: Num -> Num) ``` @@ -1199,7 +1152,6 @@ The integer part of `x` towards zero. ### `y0` Computes the Bessel function of the second kind of order 0. -**Signature:** ```tomo func y0(x: Num -> Num) ``` @@ -1220,7 +1172,6 @@ The Bessel function of the second kind of order 0 of `x`. ### `y1` Computes the Bessel function of the second kind of order 1. -**Signature:** ```tomo func y1(x: Num -> Num) ``` diff --git a/docs/paths.md b/docs/paths.md index cadc811..e39a42c 100644 --- a/docs/paths.md +++ b/docs/paths.md @@ -68,7 +68,6 @@ intended. Paths can be created from text with slashes using Appends the given text to the file at the specified path, creating the file if it doesn't already exist. Failure to write will result in a runtime error. -**Signature:** ```tomo func append(path: Path, text: Text, permissions: Int32 = 0o644[32] -> Void) ``` @@ -91,7 +90,6 @@ Nothing. Appends the given bytes to the file at the specified path, creating the file if it doesn't already exist. Failure to write will result in a runtime error. -**Signature:** ```tomo func append_bytes(path: Path, bytes: [Byte], permissions: Int32 = 0o644[32] -> Void) ``` @@ -113,7 +111,6 @@ Nothing. ### `base_name` Returns the base name of the file or directory at the specified path. -**Signature:** ```tomo func base_name(path: Path -> Text) ``` @@ -135,7 +132,6 @@ The base name of the file or directory. Returns an iterator that can be used to iterate over a file one line at a time, or returns a null value if the file could not be opened. -**Signature:** ```tomo func by_line(path: Path -> func(->Text?)?) ``` @@ -165,7 +161,6 @@ for line in (/dev/stdin):by_line()!: ### `children` Returns a list of children (files and directories) within the directory at the specified path. Optionally includes hidden files. -**Signature:** ```tomo func children(path: Path, include_hidden=no -> [Path]) ``` @@ -188,7 +183,6 @@ A list of paths for the children. Creates a new directory at the specified path with the given permissions. If any of the parent directories do not exist, they will be created as needed. -**Signature:** ```tomo func create_directory(path: Path, permissions=0o755[32] -> Void) ``` @@ -209,7 +203,6 @@ Nothing. ### `exists` Checks if a file or directory exists at the specified path. -**Signature:** ```tomo func exists(path: Path -> Bool) ``` @@ -230,7 +223,6 @@ func exists(path: Path -> Bool) ### `extension` Returns the file extension of the file at the specified path. Optionally returns the full extension. -**Signature:** ```tomo func extension(path: Path, full=yes -> Text) ``` @@ -260,7 +252,6 @@ no file extension. ### `files` Returns a list of files within the directory at the specified path. Optionally includes hidden files. -**Signature:** ```tomo func files(path: Path, include_hidden=no -> [Path]) ``` @@ -289,7 +280,6 @@ specific details: choices of patterns. - The shell-style syntax `**` for matching subdirectories is not supported. -**Signature:** ```tomo func glob(path: Path -> [Path]) ``` @@ -325,7 +315,6 @@ A list of file paths that match the glob. ### `is_directory` Checks if the path represents a directory. Optionally follows symbolic links. -**Signature:** ```tomo func is_directory(path: Path, follow_symlinks=yes -> Bool) ``` @@ -350,7 +339,6 @@ func is_directory(path: Path, follow_symlinks=yes -> Bool) ### `is_file` Checks if the path represents a file. Optionally follows symbolic links. -**Signature:** ```tomo func is_file(path: Path, follow_symlinks=yes -> Bool) ``` @@ -375,7 +363,6 @@ func is_file(path: Path, follow_symlinks=yes -> Bool) ### `is_socket` Checks if the path represents a socket. Optionally follows symbolic links. -**Signature:** ```tomo func is_socket(path: Path, follow_symlinks=yes -> Bool) ``` @@ -397,7 +384,6 @@ func is_socket(path: Path, follow_symlinks=yes -> Bool) ### `is_symlink` Checks if the path represents a symbolic link. -**Signature:** ```tomo func is_symlink(path: Path -> Bool) ``` @@ -418,7 +404,6 @@ func is_symlink(path: Path -> Bool) ### `parent` Returns the parent directory of the file or directory at the specified path. -**Signature:** ```tomo func parent(path: Path -> Path) ``` @@ -440,7 +425,6 @@ The path of the parent directory. Reads the contents of the file at the specified path or a null value if the file could not be read. -**Signature:** ```tomo func read(path: Path -> Text?) ``` @@ -466,7 +450,6 @@ raised. Reads the contents of the file at the specified path or a null value if the file could not be read. -**Signature:** ```tomo func read_bytes(path: Path -> [Byte]?) ``` @@ -491,7 +474,6 @@ returned. ### `relative` Returns the path relative to a given base path. By default, the base path is the current directory. -**Signature:** ```tomo func relative(path: Path, relative_to=(./) -> Path) ``` @@ -513,7 +495,6 @@ The relative path. ### `remove` Removes the file or directory at the specified path. A runtime error is raised if something goes wrong. -**Signature:** ```tomo func remove(path: Path, ignore_missing=no -> Void) ``` @@ -534,7 +515,6 @@ Nothing. ### `resolved` Resolves the absolute path of the given path relative to a base path. By default, the base path is the current directory. -**Signature:** ```tomo func resolved(path: Path, relative_to=(./) -> Path) ``` @@ -559,7 +539,6 @@ The resolved absolute path. ### `subdirectories` Returns a list of subdirectories within the directory at the specified path. Optionally includes hidden subdirectories. -**Signature:** ```tomo func subdirectories(path: Path, include_hidden=no -> [Path]) ``` @@ -584,7 +563,6 @@ A list of subdirectory paths. ### `unique_directory` Generates a unique directory path based on the given path. Useful for creating temporary directories. -**Signature:** ```tomo func unique_directory(path: Path -> Path) ``` @@ -611,7 +589,6 @@ Writes the given text to the file at the specified path, creating the file if it doesn't already exist. Sets the file permissions as specified. If the file writing cannot be successfully completed, a runtime error is raised. -**Signature:** ```tomo func write(path: Path, text: Text, permissions=0o644[32] -> Void) ``` @@ -635,7 +612,6 @@ Writes the given bytes to the file at the specified path, creating the file if it doesn't already exist. Sets the file permissions as specified. If the file writing cannot be successfully completed, a runtime error is raised. -**Signature:** ```tomo func write(path: Path, bytes: [Byte], permissions=0o644[32] -> Void) ``` @@ -659,7 +635,6 @@ Writes the given text to a unique file path based on the specified path. The file is created if it doesn't exist. This is useful for creating temporary files. -**Signature:** ```tomo func write_unique(path: Path, text: Text -> Path) ``` @@ -687,7 +662,6 @@ Writes the given bytes to a unique file path based on the specified path. The file is created if it doesn't exist. This is useful for creating temporary files. -**Signature:** ```tomo func write_unique_bytes(path: Path, bytes: [Byte] -> Path) ``` diff --git a/docs/rng.md b/docs/rng.md index af22c08..90c7536 100644 --- a/docs/rng.md +++ b/docs/rng.md @@ -31,7 +31,6 @@ This documentation provides details on RNG functions available in the API. ### `bool` Generate a random boolean value with a given probability. -**Signature:** ```tomo func bool(rng: RNG, p: Num = 0.5 -> Bool) ``` @@ -57,7 +56,6 @@ func bool(rng: RNG, p: Num = 0.5 -> Bool) ### `byte` Generate a random byte with uniform probability. -**Signature:** ```tomo func byte(rng: RNG -> Byte) ``` @@ -78,7 +76,6 @@ A random byte (0-255). ### `bytes` Generate an array of uniformly random bytes with the given length. -**Signature:** ```tomo func bytes(rng: RNG, count: Int -> [Byte]) ``` @@ -101,7 +98,6 @@ An array of length `count` random bytes with uniform random distribution (0-255) Return a copy of a random number generator. This copy will be a parallel version of the given RNG with its own internal state. -**Signature:** ```tomo func copy(rng: RNG -> RNG) ``` @@ -129,7 +125,6 @@ A copy of the given RNG. ### `int`, `int64`, `int32`, `int16`, `int8` Generate a random integer value with the given range. -**Signature:** ```tomo func int(rng: RNG, min: Int, max: Int -> Int) func int64(rng: RNG, min: Int64 = Int64.min, max: Int64 = Int64.max -> Int) @@ -157,7 +152,6 @@ is greater than `max`, an error will be raised. ### `new` Return a new random number generator. -**Signature:** ```tomo func new(seed: [Byte] = (/dev/urandom):read_bytes(40)! -> RNG) ``` @@ -181,7 +175,6 @@ A new random number generator. ### `num`, `num32` Generate a random floating point value with the given range. -**Signature:** ```tomo func num(rng: RNG, min: Num = 0.0, max: Num = 1.0 -> Int) func num32(rng: RNG, min: Num = 0.0_f32, max: Num = 1.0_f32 -> Int) @@ -206,7 +199,6 @@ A floating point number uniformly chosen from the range `[min, max]` ### `set_seed` Set the seed for an RNG. -**Signature:** ```tomo func set_seed(rng: RNG, seed: [Byte]) ``` diff --git a/docs/sets.md b/docs/sets.md index 6b9c645..778740a 100644 --- a/docs/sets.md +++ b/docs/sets.md @@ -90,7 +90,6 @@ iterating over any of the new values. ### `add` Adds an item to the set. -**Signature:** ```tomo func add(set:{T}, item: T -> Void) ``` @@ -111,7 +110,6 @@ Nothing. ### `add_all` Adds multiple items to the set. -**Signature:** ```tomo func add_all(set:@{T}, items: [T] -> Void) ``` @@ -132,7 +130,6 @@ Nothing. ### `clear` Removes all items from the set. -**Signature:** ```tomo func clear(set:@{T} -> Void) ``` @@ -152,7 +149,6 @@ Nothing. ### `has` Checks if the set contains a specified item. -**Signature:** ```tomo func has(set:{T}, item:T -> Bool) ``` @@ -174,7 +170,6 @@ func has(set:{T}, item:T -> Bool) ### `is_subset_of` Checks if the set is a subset of another set. -**Signature:** ```tomo func (set: {T}, other: {T}, strict: Bool = no -> Bool) ``` @@ -197,7 +192,6 @@ func (set: {T}, other: {T}, strict: Bool = no -> Bool) ### `is_superset_of` Checks if the set is a superset of another set. -**Signature:** ```tomo func is_superset_of(set:{T}, other: {T}, strict: Bool = no -> Bool) ``` @@ -217,7 +211,6 @@ func is_superset_of(set:{T}, other: {T}, strict: Bool = no -> Bool) ### `overlap` Creates a new set with items that are in both the original set and another set. -**Signature:** ```tomo func overlap(set:{T}, other: {T} -> {T}) ``` @@ -239,7 +232,6 @@ A new set containing only items present in both sets. ### `remove` Removes an item from the set. -**Signature:** ```tomo func remove(set:@{T}, item: T -> Void) ``` @@ -260,7 +252,6 @@ Nothing. ### `remove_all` Removes multiple items from the set. -**Signature:** ```tomo func remove_all(set:@{T}, items: [T] -> Void) ``` @@ -281,7 +272,6 @@ Nothing. ### `with` Creates a new set that is the union of the original set and another set. -**Signature:** ```tomo func with(set:{T}, other: {T} -> {T}) ``` @@ -303,7 +293,6 @@ A new set containing all items from both sets. ### `without` Creates a new set with items from the original set but without items from another set. -**Signature:** ```tomo func without(set:{T}, other: {T} -> {T}) ``` diff --git a/docs/shell.md b/docs/shell.md index 06d7433..6ccae99 100644 --- a/docs/shell.md +++ b/docs/shell.md @@ -21,7 +21,6 @@ user-controlled string is automatically escaped when performing interpolation. ### `by_line` Run a shell command and return an iterator over its output, line-by-line. -**Signature:** ```tomo func by_line(command: Shell -> Void) ``` @@ -43,7 +42,6 @@ for line in $Shell"ping www.example.com":by_line()!: ### `execute` Execute a shell command without capturing its output and return its exit status. -**Signature:** ```tomo func execute(command: Shell -> Int32?) ``` @@ -64,7 +62,6 @@ If the command exits normally, return its exit status. Otherwise return `none`. ### `run` Run a shell command and return the output text from `stdout`. -**Signature:** ```tomo func run(command: Shell -> Text?) ``` @@ -87,7 +84,6 @@ if there is a trailing newline, it will be stripped. ### `run_bytes` Run a shell command and return the output in raw bytes from `stdout`. -**Signature:** ```tomo func run(command: Shell -> [Byte]?) ``` diff --git a/docs/tables.md b/docs/tables.md index a687c0c..42af25d 100644 --- a/docs/tables.md +++ b/docs/tables.md @@ -144,7 +144,6 @@ iterating over any of the new values. Increments the value associated with a key by a specified amount. If the key is not already in the table, its value will be assumed to be zero. -**Signature:** ```tomo func bump(t:@{K,V}, key: K, amount: Int = 1 -> Void) ``` @@ -170,7 +169,6 @@ t:bump("B", 10) ### `clear` Removes all key-value pairs from the table. -**Signature:** ```tomo func clear(t:@{K,V}) ``` @@ -190,7 +188,6 @@ Nothing. ### `get` Retrieves the value associated with a key, or returns null if the key is not present. -**Signature:** ```tomo func get(t:{K,V}, key: K -> V?) ``` @@ -222,7 +219,6 @@ The value associated with the key or null if the key is not found. ### `has` Checks if the table contains a specified key. -**Signature:** ```tomo func has(t:{K,V}, key: K -> Bool) ``` @@ -246,7 +242,6 @@ func has(t:{K,V}, key: K -> Bool) ### `remove` Removes the key-value pair associated with a specified key. -**Signature:** ```tomo func remove(t:{K,V}, key: K -> Void) ``` @@ -270,7 +265,6 @@ t:remove("A") ### `set` Sets or updates the value associated with a specified key. -**Signature:** ```tomo func set(t:{K,V}, key: K, value: V -> Void) ``` diff --git a/docs/text.md b/docs/text.md index a97f3bc..df759c1 100644 --- a/docs/text.md +++ b/docs/text.md @@ -309,7 +309,6 @@ pattern documentation](patterns.md) for more details. ### `as_c_string` Converts a `Text` value to a C-style string. -**Signature:** ```tomo func as_c_string(text: Text -> CString) ``` @@ -331,7 +330,6 @@ A C-style string (`CString`) representing the text. Get the graphical cluster at a given index. This is similar to `str[i]` with ASCII text, but has more correct behavior for unicode text. -**Signature:** ```tomo func at(text: Text, index: Int -> Text) ``` @@ -356,7 +354,6 @@ indices are counted from the back of the text, so `-1` means the last cluster, Returns an iterator function that can be used to iterate over the lines in a text. -**Signature:** ```tomo func by_line(text: Text -> func(->Text?)) ``` @@ -385,7 +382,6 @@ for line in text:by_line(): Returns an iterator function that can be used to iterate over the occurrences of a pattern in a text. -**Signature:** ```tomo func by_match(text: Text, pattern: Pattern -> func(->Match?)) ``` @@ -412,7 +408,6 @@ for match in text:by_match($/{alpha}/): Returns an iterator function that can be used to iterate over text separated by a pattern. -**Signature:** ```tomo func by_split(text: Text, pattern: Pattern = $// -> func(->Text?)) ``` @@ -439,7 +434,6 @@ for chunk in text:by_split($/,/): Converts a `Text` value to an array of bytes representing a UTF8 encoding of the text. -**Signature:** ```tomo func bytes(text: Text -> [Byte]) ``` @@ -460,7 +454,6 @@ An array of bytes (`[Byte]`) representing the text in UTF8 encoding. ### `codepoint_names` Returns an array of the names of each codepoint in the text. -**Signature:** ```tomo func codepoint_names(text: Text -> [Text]) ``` @@ -482,7 +475,6 @@ An array of codepoint names (`[Text]`). Iterates over each match of a [pattern](patterns.md) and passes the match to the given function. -**Signature:** ```tomo func each(text: Text, pattern: Pattern, fn: func(m: Match), recursive: Bool = yes -> Int?) ``` @@ -508,7 +500,6 @@ None. ### `ends_with` Checks if the `Text` ends with a literal suffix text. -**Signature:** ```tomo func ends_with(text: Text, suffix: Text -> Bool) ``` @@ -531,7 +522,6 @@ func ends_with(text: Text, suffix: Text -> Bool) Finds the first occurrence of a [pattern](patterns.md) in the given text (if any). -**Signature:** ```tomo func find(text: Text, pattern: Pattern, start: Int = 1 -> Int?) ``` @@ -561,7 +551,6 @@ struct containing information about the match. ### `find_all` Finds all occurrences of a [pattern](patterns.md) in the given text. -**Signature:** ```tomo func find_all(text: Text, pattern: Pattern -> [Match]) ``` @@ -596,7 +585,6 @@ Note: if `text` or `pattern` is empty, an empty array will be returned. ### `from` Get a slice of the text, starting at the given position. -**Signature:** ```tomo func from(text: Text, first: Int -> Text) ``` @@ -626,7 +614,6 @@ Returns text that has been constructed from the given UTF8 bytes. Note: the text will be normalized, so the resulting text's UTF8 bytes may not exactly match the input. -**Signature:** ```tomo func from_codepoint_names(codepoints: [Int32] -> [Text]) ``` @@ -647,7 +634,6 @@ A new text based on the input UTF8 bytes after normalization has been applied. ### `from_c_string` Converts a C-style string to a `Text` value. -**Signature:** ```tomo func from_c_string(str: CString -> Text) ``` @@ -670,7 +656,6 @@ Returns text that has the given codepoint names (according to the Unicode specification) as its codepoints. Note: the text will be normalized, so the resulting text's codepoints may not exactly match the input codepoints. -**Signature:** ```tomo func from_codepoint_names(codepoint_names: [Text] -> [Text]) ``` @@ -699,7 +684,6 @@ Returns text that has been constructed from the given UTF32 codepoints. Note: the text will be normalized, so the resulting text's codepoints may not exactly match the input codepoints. -**Signature:** ```tomo func from_codepoint_names(codepoints: [Int32] -> [Text]) ``` @@ -720,7 +704,6 @@ A new text with the specified codepoints after normalization has been applied. ### `has` Checks if the `Text` contains a target [pattern](patterns.md). -**Signature:** ```tomo func has(text: Text, pattern: Pattern -> Bool) ``` @@ -748,7 +731,6 @@ func has(text: Text, pattern: Pattern -> Bool) ### `join` Joins an array of text pieces with a specified glue. -**Signature:** ```tomo func join(glue: Text, pieces: [Text] -> Text) ``` @@ -771,7 +753,6 @@ A single `Text` value with the pieces joined by the glue. Splits the text into an array of lines of text, preserving blank lines, ignoring trailing newlines, and handling `\r\n` the same as `\n`. -**Signature:** ```tomo func split(text: Text -> [Text]) ``` @@ -800,7 +781,6 @@ An array of substrings resulting from the split. ### `lower` Converts all characters in the text to lowercase. -**Signature:** ```tomo func lower(text: Text -> Text) ``` @@ -822,7 +802,6 @@ The lowercase version of the text. For each occurrence of the given [pattern](patterns.md), replace the text with the result of calling the given function on that match. -**Signature:** ```tomo func map(text: Text, pattern: Pattern, fn: func(text:Match)->Text -> Text, recursive: Bool = yes) ``` @@ -852,7 +831,6 @@ Checks if the `Text` matches target [pattern](patterns.md) and returns an array of the matching text captures or a null value if the entire text doesn't match the pattern. -**Signature:** ```tomo func matches(text: Text, pattern: Pattern -> [Text]) ``` @@ -878,7 +856,6 @@ or a null value otherwise. ### `quoted` Formats the text as a quoted string. -**Signature:** ```tomo func quoted(text: Text, color: Bool = no -> Text) ``` @@ -900,7 +877,6 @@ The text formatted as a quoted string. ### `repeat` Repeat some text multiple times. -**Signature:** ```tomo func repeat(text: Text, count:Int -> Text) ``` @@ -923,7 +899,6 @@ The text repeated the given number of times. Replaces occurrences of a [pattern](patterns.md) in the text with a replacement string. -**Signature:** ```tomo func replace(text: Text, pattern: Pattern, replacement: Text, backref: Pattern = $/\/, recursive: Bool = yes -> Text) ``` @@ -989,7 +964,6 @@ on to *after* the replacement text, so replacement text is not recursively modified. See [`replace()`](#replace) for more information about replacement behavior. -**Signature:** ```tomo func replace_all(replacements:{Pattern,Text}, backref: Pattern = $/\/, recursive: Bool = yes -> Text) ``` @@ -1029,7 +1003,6 @@ replacement text. ### `reversed` Return a text that has the grapheme clusters in reverse order. -**Signature:** ```tomo func reversed(text: Text -> Text) ``` @@ -1050,7 +1023,6 @@ A reversed version of the text. ### `slice` Get a slice of the text. -**Signature:** ```tomo func slice(text: Text, from: Int = 1, to: Int = -1 -> Text) ``` @@ -1082,7 +1054,6 @@ the string. ### `split` Splits the text into an array of substrings based on a [pattern](patterns.md). -**Signature:** ```tomo func split(text: Text, pattern: Pattern = "" -> [Text]) ``` @@ -1114,7 +1085,6 @@ An array of substrings resulting from the split. ### `starts_with` Checks if the `Text` starts with a literal prefix text. -**Signature:** ```tomo func starts_with(text: Text, prefix: Text -> Bool) ``` @@ -1136,7 +1106,6 @@ func starts_with(text: Text, prefix: Text -> Bool) ### `title` Converts the text to title case (capitalizing the first letter of each word). -**Signature:** ```tomo func title(text: Text -> Text) ``` @@ -1157,7 +1126,6 @@ The text in title case. ### `to` Get a slice of the text, ending at the given position. -**Signature:** ```tomo func to(text: Text, last: Int -> Text) ``` @@ -1185,7 +1153,6 @@ the string. ### `trim` Trims the matching [pattern](patterns.md) from the left and/or right side of the text. -**Signature:** ```tomo func trim(text: Text, pattern: Pattern = $/{whitespace/, trim_left: Bool = yes, trim_right: Bool = yes -> Text) ``` @@ -1215,7 +1182,6 @@ The text without the trim pattern at either end. ### `upper` Converts all characters in the text to uppercase. -**Signature:** ```tomo func upper(text: Text -> Text) ``` @@ -1236,7 +1202,6 @@ The uppercase version of the text. ### `utf32_codepoints` Returns an array of Unicode code points for UTF32 encoding of the text. -**Signature:** ```tomo func utf32_codepoints(text: Text -> [Int32]) ``` diff --git a/docs/threads.md b/docs/threads.md index 4d8f896..3bd2dd0 100644 --- a/docs/threads.md +++ b/docs/threads.md @@ -14,7 +14,6 @@ through [mutex-guarded datastructures](mutexed.md). ### `cancel` Requests the cancellation of a specified thread. -**Signature:** ```tomo func cancel(thread: Thread) ``` @@ -34,7 +33,6 @@ Nothing. ### `detach` Detaches a specified thread, allowing it to run independently. -**Signature:** ```tomo func detach(thread: Thread) ``` @@ -51,7 +49,6 @@ Nothing. ### `join` Waits for a specified thread to terminate. -**Signature:** ```tomo func join(thread: Thread) ``` @@ -71,7 +68,6 @@ Nothing. ### `new` Creates a new thread to execute a specified function. -**Signature:** ```tomo func new(fn: func(->Void) -> Thread) ```