From 3f030ca50550ae42578f1a2d5776280d7f8d98d9 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sat, 15 Jun 2024 18:12:28 -0400 Subject: [PATCH] add back to top links --- prelude.md | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/prelude.md b/prelude.md index bb66aef..62df3ea 100644 --- a/prelude.md +++ b/prelude.md @@ -81,6 +81,7 @@ Returns the absolute value of a number. (0) (n as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### add @@ -92,6 +93,7 @@ Adds numbers or vectors. (x, y, ...) ((x1, y1), (x2, y2)) ``` +[Back to top.](#ludus-prelude-documentation) ### and @@ -102,6 +104,7 @@ Returns true if all values passed in are truthy. Note that this does not short-c (x, y) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### angle @@ -109,6 +112,7 @@ Calculates the angle between two vectors. ``` (v1, v2) ``` +[Back to top.](#ludus-prelude-documentation) ### any? @@ -121,6 +125,7 @@ Returns true if something is not empty, otherwise returns false (including for t (s as :string) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### append @@ -132,6 +137,7 @@ Adds an element to a list or set. (xs as :set) (xs as :set, x) ``` +[Back to top.](#ludus-prelude-documentation) ### assert! @@ -140,6 +146,7 @@ Asserts a condition: returns the value if the value is truthy, panics if the val (value) (msg, value) ``` +[Back to top.](#ludus-prelude-documentation) ### assoc @@ -150,6 +157,7 @@ Takes a dict, key, and value, and returns a new dict with the key set to value. (dict as :dict, key as :keyword, value) (dict as :dict, (key as :keyword, value)) ``` +[Back to top.](#ludus-prelude-documentation) ### assoc? @@ -159,6 +167,7 @@ Returns true if a value is an associative collection: a dict or a pkg. (assoc as :pkg) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### at @@ -169,6 +178,7 @@ Returns the element at index n of a list or tuple, or the byte at index n of a s (str as :string, n as :number) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### atan/2 @@ -181,6 +191,7 @@ Returns an angle from a slope. Takes an optional keyword argument to specify uni ((x, y)) ((x, y), units as :keyword) ``` +[Back to top.](#ludus-prelude-documentation) ### back! @@ -188,6 +199,7 @@ Moves the turtle backward by a number of steps. Alias: bk! ``` (steps as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### background! @@ -197,6 +209,7 @@ Sets the background color behind the turtle and path. Alias: bg! ((r as :number, g as :number, b as :number)) ((r as :number, g as :number, b as :number, a as :number)) ``` +[Back to top.](#ludus-prelude-documentation) ### between? @@ -204,6 +217,7 @@ Returns true if a number is in the range [lower, higher): greater than or equal ``` (lower as :number, higher as :number, x as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### bg! @@ -213,6 +227,7 @@ Sets the background color behind the turtle and path. Alias: bg! ((r as :number, g as :number, b as :number)) ((r as :number, g as :number, b as :number, a as :number)) ``` +[Back to top.](#ludus-prelude-documentation) ### bgcolor @@ -224,6 +239,7 @@ Moves the turtle backward by a number of steps. Alias: bk! ``` (steps as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### bool @@ -233,6 +249,7 @@ Returns false if a value is nil or false, otherwise returns true. (false) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### bool? @@ -242,6 +259,7 @@ Returns true if a value is of type :boolean. (true) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### box? @@ -250,6 +268,7 @@ Returns true if a value is a box. (b as :box) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### butlast @@ -257,6 +276,7 @@ Returns a list, omitting the last element. ``` (xs as :list) ``` +[Back to top.](#ludus-prelude-documentation) ### ceil @@ -264,6 +284,7 @@ Truncates a number towards positive infinity. With negative numbers, it returns ``` (n as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### clear! @@ -271,6 +292,7 @@ Clears the canvas and sends the turtle home. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### coll? @@ -283,6 +305,7 @@ Returns true if a value is a collection: dict, list, pkg, tuple, or set. (coll as :pkg) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### colors @@ -297,6 +320,7 @@ Combines two lists, strings, or sets. (xs as :set, ys as :set) (xs, ys, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### cos @@ -307,6 +331,7 @@ Returns the cosine of an angle. Default angle measure is turns. An optional keyw (a as :number, :degrees) (a as :number, :radians) ``` +[Back to top.](#ludus-prelude-documentation) ### count @@ -318,6 +343,7 @@ Returns the number of elements in a collection (including string). (xs as :string) (xs as :set) ``` +[Back to top.](#ludus-prelude-documentation) ### dec @@ -325,6 +351,7 @@ Decrements a number. ``` (x as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### deg/rad @@ -332,6 +359,7 @@ Converts an angle in degrees to an angle in radians. ``` (a as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### deg/turn @@ -339,6 +367,7 @@ Converts an angle in degrees to an angle in turns. ``` (a as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### dict @@ -348,6 +377,7 @@ Takes a list or tuple of (key, value) tuples and returns it as a dict. Returns d (list as :list) (tup as :tuple) ``` +[Back to top.](#ludus-prelude-documentation) ### dict? @@ -356,6 +386,7 @@ Returns true if a value is a dict. (dict as :dict) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### diff @@ -363,6 +394,7 @@ Takes two dicts and returns a dict describing their differences. Does this shall ``` (d1 as :dict, d2 as :dict) ``` +[Back to top.](#ludus-prelude-documentation) ### dissoc @@ -371,6 +403,7 @@ Takes a dict and a key, and returns a new dict with the key and associated value (dict as :dict) (dict as :dict, key as :keyword) ``` +[Back to top.](#ludus-prelude-documentation) ### dist @@ -379,6 +412,7 @@ Returns the distance from the origin to a point described by (x, y). (x as :number, y as :number) ((x, y)) ``` +[Back to top.](#ludus-prelude-documentation) ### div @@ -389,6 +423,7 @@ Divides numbers. Panics on division by zero. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### div/0 @@ -399,6 +434,7 @@ Divides numbers. Returns 0 on division by zero. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### div/safe @@ -409,6 +445,7 @@ Divides a number. Returns a result tuple. (x, y) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### doc! @@ -417,6 +454,7 @@ Prints the documentation of a function to the console. (f as :fn) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### downcase @@ -424,6 +462,7 @@ Takes a string and returns it in all lowercase. Works only for ascii characters. ``` (str as :string) ``` +[Back to top.](#ludus-prelude-documentation) ### each! @@ -433,6 +472,7 @@ Takes a list and applies a function, presumably with side effects, to each eleme (f! as :fn, [x]) (f! as :fn, [...]) ``` +[Back to top.](#ludus-prelude-documentation) ### empty? @@ -445,6 +485,7 @@ Returns true if something is empty. Otherwise returns false (including for thing ("") (_) ``` +[Back to top.](#ludus-prelude-documentation) ### eq? @@ -454,6 +495,7 @@ Returns true if all arguments have the same value. (x, y) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### err @@ -461,6 +503,7 @@ Takes a value and wraps it in an :err result tuple, presumably as an error messa ``` (msg) ``` +[Back to top.](#ludus-prelude-documentation) ### err? @@ -469,6 +512,7 @@ Takes a value and returns true if it is an :err result tuple. ((:err, _)) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### even? @@ -477,6 +521,7 @@ Returns true if a value is an even number, otherwise returns false. (x as :number) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### false? @@ -485,6 +530,7 @@ Returns `true` if a value is `false`, otherwise returns `false`. Useful to disti (false) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### fd! @@ -492,6 +538,7 @@ Moves the turtle forward by a number of steps. Alias: fd! ``` (steps as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### filter @@ -499,6 +546,7 @@ Takes a list and a predicate function, and returns a new list with only the item ``` (p? as :fn, xs) ``` +[Back to top.](#ludus-prelude-documentation) ### first @@ -506,6 +554,7 @@ Returns the first element of a list or tuple. ``` (xs) ``` +[Back to top.](#ludus-prelude-documentation) ### floor @@ -513,6 +562,7 @@ Truncates a number towards negative infinity. With positive numbers, it returns ``` (n as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### fn? @@ -521,6 +571,7 @@ Returns true if an argument is a function. (f as :fn) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### fold @@ -529,6 +580,7 @@ Folds a list. (f as :fn, xs as :list) (f as :fn, xs as :list, root) ``` +[Back to top.](#ludus-prelude-documentation) ### forward! @@ -536,6 +588,7 @@ Moves the turtle forward by a number of steps. Alias: fd! ``` (steps as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### get @@ -545,6 +598,7 @@ Takes a key, dict, and optional default value; returns the value at key. If the (key as :keyword, dict as :dict) (key as :keyword, dict as :dict, default) ``` +[Back to top.](#ludus-prelude-documentation) ### goto! @@ -553,6 +607,7 @@ Sends the turtle to (x, y) coordinates. If the pen is down, the turtle will draw (x as :number, y as :number) ((x, y)) ``` +[Back to top.](#ludus-prelude-documentation) ### gt? @@ -562,6 +617,7 @@ Returns true if numbers are in decreasing order. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### gte? @@ -571,6 +627,7 @@ Returns true if numbers are in decreasing or flat order. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### heading @@ -578,6 +635,7 @@ Returns the turtle's current heading. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### heading/vector @@ -585,6 +643,7 @@ Takes a turtle heading, and returns a unit vector of that heading. ``` (heading) ``` +[Back to top.](#ludus-prelude-documentation) ### home! @@ -592,6 +651,7 @@ Sends the turtle home: to the centre of the screen, pointing up. If the pen is d ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### inc @@ -599,6 +659,7 @@ Increments a number. ``` (x as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### inv @@ -606,6 +667,7 @@ Returns the inverse of a number: 1/n or `div (1, n)`. Panics on division by zero ``` (x as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### inv/0 @@ -613,6 +675,7 @@ Returns the inverse of a number: 1/n or `div/0 (1, n)`. Returns 0 on division by ``` (x as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### inv/safe @@ -620,6 +683,7 @@ Returns the inverse of a number: 1/n or `div/safe (1, n)`. Returns a result tupl ``` (x as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### join @@ -631,6 +695,7 @@ Takes a list of strings, and joins them into a single string, interposing an opt ([str], separator as :string) ([str, ...], separator as :string) ``` +[Back to top.](#ludus-prelude-documentation) ### keep @@ -638,6 +703,7 @@ Takes a list and returns a new list with any `nil` values omitted. ``` (xs) ``` +[Back to top.](#ludus-prelude-documentation) ### keys @@ -645,6 +711,7 @@ Takes a dict and returns a list of keys in that dict. ``` (dict as :dict) ``` +[Back to top.](#ludus-prelude-documentation) ### keyword? @@ -653,6 +720,7 @@ Returns true if a value is a keyword, otherwise returns false. (kw as :keyword) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### last @@ -660,6 +728,7 @@ Returns the last element of a list or tuple. ``` (xs) ``` +[Back to top.](#ludus-prelude-documentation) ### left! @@ -667,6 +736,7 @@ Rotates the turtle left, measured in turns. Alias: lt! ``` (turns as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### list @@ -674,6 +744,7 @@ Takes a value and returns it as a list. For values, it simply wraps them in a li ``` (x) ``` +[Back to top.](#ludus-prelude-documentation) ### list? @@ -682,6 +753,7 @@ Returns true if the value is a list. (l as :list) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### load_turtle_state! @@ -689,6 +761,7 @@ Sets the turtle state to a previously saved state. Returns the state. ``` (state) ``` +[Back to top.](#ludus-prelude-documentation) ### lt! @@ -696,6 +769,7 @@ Rotates the turtle left, measured in turns. Alias: lt! ``` (turns as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### lt? @@ -705,6 +779,7 @@ Returns true if numbers are in increasing order. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### lte? @@ -714,6 +789,7 @@ Returns true if numbers are in increasing or flat order. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### map @@ -722,6 +798,7 @@ Maps a function over a list: returns a new list with elements that are the resul (f as :fn, xs) (kw as :keyword, xs) ``` +[Back to top.](#ludus-prelude-documentation) ### max @@ -731,6 +808,7 @@ Returns the number in its arguments that is closest to positive infinity. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### min @@ -740,6 +818,7 @@ Returns the number in its arguments that is closest to negative infinity. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### mod @@ -747,6 +826,7 @@ Returns the modulus of num and div. Truncates towards negative infinity. ``` (num as :number, div as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### mult @@ -759,6 +839,7 @@ Multiplies numbers or vectors. (scalar as :number, (x, y)) ((x, y), scalar as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### neg @@ -766,6 +847,7 @@ Multiplies a number by -1, negating it. ``` (n as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### neg? @@ -774,6 +856,7 @@ Returns true if a value is a negative number, otherwise returns false. (x as :number) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### neq? @@ -783,6 +866,7 @@ Returns true if none of the arguments have the same value. (x, y) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### nil? @@ -791,6 +875,7 @@ Returns true if a value is nil. (nil) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### not @@ -800,6 +885,7 @@ Returns false if a value is truthy, true if a value is falsy. (false) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### odd? @@ -808,6 +894,7 @@ Returns true if a value is an odd number, otherwise returns false. (x as :number) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### ok @@ -815,6 +902,7 @@ Takes a value and wraps it in an :ok result tuple. ``` (value) ``` +[Back to top.](#ludus-prelude-documentation) ### ok? @@ -823,6 +911,7 @@ Takes a value and returns true if it is an :ok result tuple. ((:ok, _)) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### or @@ -833,6 +922,7 @@ Returns true if any value passed in is truthy. Note that this does not short-cir (x, y) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### ordered? @@ -842,6 +932,7 @@ Returns true if a value is an indexed collection: list or tuple. (coll as :tuple) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### p5_calls @@ -855,6 +946,7 @@ Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or ((r as :number, g as :number, b as :number)) ((r as :number, g as :number, b as :number, a as :number)) ``` +[Back to top.](#ludus-prelude-documentation) ### pd! @@ -862,6 +954,7 @@ Lowers the turtle's pen, causing it to draw. Alias: pd! ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### pencolor @@ -869,6 +962,7 @@ Returns the turtle's pen color as an (r, g, b, a) tuple. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### pencolor! @@ -878,6 +972,7 @@ Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or ((r as :number, g as :number, b as :number)) ((r as :number, g as :number, b as :number, a as :number)) ``` +[Back to top.](#ludus-prelude-documentation) ### pendown! @@ -885,6 +980,7 @@ Lowers the turtle's pen, causing it to draw. Alias: pd! ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### pendown? @@ -892,6 +988,7 @@ Returns the turtle's pen state: true if the pen is down. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### penup! @@ -899,6 +996,7 @@ Lifts the turtle's pen, stopping it from drawing. Alias: pu! ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### penwidth @@ -906,6 +1004,7 @@ Returns the turtle's pen width in pixels. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### penwidth! @@ -913,6 +1012,7 @@ Sets the width of the turtle's pen, measured in pixels. Alias: pw! ``` (width as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### pi @@ -925,6 +1025,7 @@ Returns true if a value is a positive number, otherwise returns false. (x as :number) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### position @@ -932,6 +1033,7 @@ Returns the turtle's current position. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### print! @@ -939,6 +1041,7 @@ Sends a text representation of Ludus values to the console. ``` (...) ``` +[Back to top.](#ludus-prelude-documentation) ### pu! @@ -946,6 +1049,7 @@ Lifts the turtle's pen, stopping it from drawing. Alias: pu! ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### pw! @@ -953,6 +1057,7 @@ Sets the width of the turtle's pen, measured in pixels. Alias: pw! ``` (width as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### rad/deg @@ -960,6 +1065,7 @@ Converts an angle in radians to an angle in degrees. ``` (a as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### rad/turn @@ -967,6 +1073,7 @@ Converts an angle in radians to an angle in turns. ``` (a as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### random @@ -978,6 +1085,7 @@ Returns a random number. With zero arguments, returns a random number between 0 (l as :list) (d as :dict) ``` +[Back to top.](#ludus-prelude-documentation) ### random_int @@ -986,6 +1094,7 @@ Returns a random integer. With one argument, returns a random integer between 0 (n as :number) (m as :number, n as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### range @@ -994,6 +1103,7 @@ Returns the set of integers between start (inclusive) and end (exclusive) as a l (end as :number) (start as :number, end as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### render_turtle! @@ -1001,6 +1111,7 @@ No docstring available. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### report! @@ -1009,6 +1120,7 @@ Prints a value, then returns it. (x) (msg as :string, x) ``` +[Back to top.](#ludus-prelude-documentation) ### reset_turtle! @@ -1016,6 +1128,7 @@ Resets the turtle to its original state. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### rest @@ -1024,6 +1137,7 @@ Returns all but the first element of a list or tuple, as a list. (xs as :list) (xs as :tuple) ``` +[Back to top.](#ludus-prelude-documentation) ### right! @@ -1031,6 +1145,7 @@ Rotates the turtle right, measured in turns. Alias: rt! ``` (turns as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### round @@ -1038,6 +1153,7 @@ Rounds a number to the nearest integer. ``` (n as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### rt! @@ -1045,6 +1161,7 @@ Rotates the turtle right, measured in turns. Alias: rt! ``` (turns as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### second @@ -1052,6 +1169,7 @@ Returns the second element of a list or tuple. ``` (xs) ``` +[Back to top.](#ludus-prelude-documentation) ### sentence @@ -1059,6 +1177,7 @@ Takes a list of words and turns it into a sentence. ``` (strs as :list) ``` +[Back to top.](#ludus-prelude-documentation) ### set @@ -1067,6 +1186,7 @@ Takes an ordered collection--list or tuple--and turns it into a set. (xs as :list) (xs as :tuple) ``` +[Back to top.](#ludus-prelude-documentation) ### set? @@ -1075,6 +1195,7 @@ Returns true if a value is a set. (xs as :set) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### show @@ -1082,6 +1203,7 @@ Returns a text representation of a Ludus value as a string. ``` (x) ``` +[Back to top.](#ludus-prelude-documentation) ### sin @@ -1092,6 +1214,7 @@ Returns the sine of an angle. Default angle measure is turns. An optional keywor (a as :number, :degrees) (a as :number, :radians) ``` +[Back to top.](#ludus-prelude-documentation) ### slice @@ -1102,6 +1225,7 @@ Returns a slice of a list, representing a sub-list. (str as :string, end as :number) (str as :string, start as :number, end as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### some @@ -1110,6 +1234,7 @@ Takes a possibly nil value and a default value. Returns the value if it's not ni (nil, default) (value, _) ``` +[Back to top.](#ludus-prelude-documentation) ### some? @@ -1118,6 +1243,7 @@ Returns true if a value is not nil. (nil) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### split @@ -1125,6 +1251,7 @@ Takes a string, and turns it into a list of strings, breaking on the separator. ``` (str as :string, break as :string) ``` +[Back to top.](#ludus-prelude-documentation) ### square @@ -1132,6 +1259,7 @@ Squares a number. ``` (x as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### state @@ -1143,6 +1271,7 @@ Stores a value in a box, replacing the value that was previously there. Returns ``` (b as :box, value) ``` +[Back to top.](#ludus-prelude-documentation) ### string @@ -1152,6 +1281,7 @@ Converts a value to a string by using `show`. If it is a string, returns it unha (x) (x, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### string? @@ -1160,6 +1290,7 @@ Returns true if a value is a string. (x as :string) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### strip @@ -1173,6 +1304,7 @@ Removes punctuation from a string, removing all instances of ,.;:?! ("{x}!{y}") (x) ``` +[Back to top.](#ludus-prelude-documentation) ### sub @@ -1184,6 +1316,7 @@ Subtracts numbers or vectors. (x, y, ...) ((x1, y1), (x2, y2)) ``` +[Back to top.](#ludus-prelude-documentation) ### sum_of_squares @@ -1194,6 +1327,7 @@ Returns the sum of squares of numbers. (x as :number, y as :number) (x, y, ...) ``` +[Back to top.](#ludus-prelude-documentation) ### tan @@ -1204,6 +1338,7 @@ Returns the sine of an angle. Default angle measure is turns. An optional keywor (a as :number, :degrees) (a as :number, :radians) ``` +[Back to top.](#ludus-prelude-documentation) ### tau @@ -1217,6 +1352,7 @@ Trims whitespace from a string. Takes an optional argument, `:left` or `:right`, (str as :string, :left) (str as :string, :right) ``` +[Back to top.](#ludus-prelude-documentation) ### tuple? @@ -1225,6 +1361,7 @@ Returns true if a value is a tuple. (tuple as :tuple) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### turn/deg @@ -1232,6 +1369,7 @@ Converts an angle in turns to an angle in degrees. ``` (a as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### turn/rad @@ -1239,6 +1377,7 @@ Converts an angle in turns to an angle in radians. ``` (a as :number) ``` +[Back to top.](#ludus-prelude-documentation) ### turtle_commands @@ -1250,6 +1389,7 @@ Returns the turtle's current state. ``` () ``` +[Back to top.](#ludus-prelude-documentation) ### turtle_states @@ -1261,6 +1401,7 @@ Returns a keyword representing the type of the value passed in. ``` (x) ``` +[Back to top.](#ludus-prelude-documentation) ### unbox @@ -1268,6 +1409,7 @@ Returns the value that is stored in a box. ``` (b as :box) ``` +[Back to top.](#ludus-prelude-documentation) ### unwrap! @@ -1277,6 +1419,7 @@ Takes a result tuple. If it's :ok, then returns the value. If it's not :ok, then ((:err, msg)) (_) ``` +[Back to top.](#ludus-prelude-documentation) ### unwrap_or @@ -1285,6 +1428,7 @@ Takes a value that is a result tuple and a default value. If it's :ok, then it r ((:ok, value), _) ((:err, _), default) ``` +[Back to top.](#ludus-prelude-documentation) ### upcase @@ -1292,6 +1436,7 @@ Takes a string and returns it in all uppercase. Works only for ascii characters. ``` (str as :string) ``` +[Back to top.](#ludus-prelude-documentation) ### update @@ -1300,6 +1445,7 @@ Takes a dict, key, and function, and returns a new dict with the key set to the (dict as :dict) (dict as :dict, key as :keyword, updater as :fn) ``` +[Back to top.](#ludus-prelude-documentation) ### update! @@ -1307,6 +1453,7 @@ Updates a box by applying a function to its value. Returns the new value. ``` (b as :box, f as :fn) ``` +[Back to top.](#ludus-prelude-documentation) ### values @@ -1314,6 +1461,7 @@ Takes a dict and returns a list of values in that dict. ``` (dict) ``` +[Back to top.](#ludus-prelude-documentation) ### words @@ -1321,6 +1469,7 @@ Takes a string and returns a list of the words in the string. Strips all whitesp ``` (str as :string) ``` +[Back to top.](#ludus-prelude-documentation) ### ws? @@ -1331,6 +1480,7 @@ Tells if a string is a whitespace character. ("\t") (_) ``` +[Back to top.](#ludus-prelude-documentation) ### zero? @@ -1339,3 +1489,4 @@ Returns true if a number is 0. (0) (_) ``` +[Back to top.](#ludus-prelude-documentation)