From e899bc96f0e8c546762124bc60362f46d980d9f4 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sat, 15 Jun 2024 21:53:09 -0400 Subject: [PATCH] updated doc --- prelude.md | 235 +++++++++++++++-------------------------------------- 1 file changed, 66 insertions(+), 169 deletions(-) diff --git a/prelude.md b/prelude.md index 2d9cec6..c6f14f2 100644 --- a/prelude.md +++ b/prelude.md @@ -37,10 +37,10 @@ You can see what this looks like in the last clause of `add`: `((x1, y1), (x2, y ## Functions by topic ### Boolean -[and](#and)    [bool](#bool)    [bool?](#bool)    [false?](#false)    [not](#not)    [or](#or) +[and](#and)    [bool](#bool)    [bool?](#bool)    [false?](#false)    [not](#not)    [or](#or)    [true?](#true) ### Boxes and state -[store!](#store)    [unbox](#unbox)    [update!](#update) +[box?](#box)    [store!](#store)    [unbox](#unbox)    [update!](#update) ### Dicts [any?](#any)    [assoc](#assoc)    [assoc?](#assoc)    [coll?](#coll)    [count](#count)    [dict](#dict)    [dict?](#dict)    [diff](#diff)    [dissoc](#dissoc)    [empty?](#empty)    [get](#get)    [keys](#keys)    [random](#random)    [update](#update)    [values](#values) @@ -55,27 +55,30 @@ You can see what this looks like in the last clause of `add`: `((x1, y1), (x2, y [any?](#any)    [append](#append)    [at](#at)    [butlast](#butlast)    [coll?](#coll)    [concat](#concat)    [count](#count)    [each!](#each)    [empty?](#empty)    [filter](#filter)    [first](#first)    [fold](#fold)    [join](#join)    [keep](#keep)    [last](#last)    [list](#list)    [list?](#list)    [map](#map)    [ordered?](#ordered)    [random](#random)    [range](#range)    [rest](#rest)    [second](#second)    [sentence](#sentence)    [slice](#slice) ### Math -[abs](#abs)    [add](#add)    [angle](#angle)    [atan/2](#atan/2)    [between?](#between)    [ceil](#ceil)    [cos](#cos)    [dec](#dec)    [deg/rad](#deg/rad)    [deg/turn](#deg/turn)    [dist](#dist)    [div](#div)    [div/0](#div/0)    [div/safe](#div/safe)    [even?](#even)    [floor](#floor)    [gt?](#gt)    [gte?](#gte)    [heading/vector](#heading/vector)    [inc](#inc)    [inv](#inv)    [inv/0](#inv/0)    [inv/safe](#inv/safe)    [lt?](#lt)    [lte?](#lte)    [max](#max)    [min](#min)    [mod](#mod)    [mult](#mult)    [neg](#neg)    [neg?](#neg)    [odd?](#odd)    [pi](#pi)    [pos?](#pos)    [rad/deg](#rad/deg)    [rad/turn](#rad/turn)    [random](#random)    [random\_int](#random\_int)    [range](#range)    [round](#round)    [sin](#sin)    [square](#square)    [sub](#sub)    [sum\_of_squares](#sum\_of_squares)    [tan](#tan)    [tau](#tau)    [turn/deg](#turn/deg)    [turn/rad](#turn/rad)    [zero?](#zero) +[abs](#abs)    [add](#add)    [angle](#angle)    [atan/2](#atan/2)    [between?](#between)    [ceil](#ceil)    [cos](#cos)    [dec](#dec)    [deg/rad](#deg/rad)    [deg/turn](#deg/turn)    [dist](#dist)    [div](#div)    [div/0](#div/0)    [div/safe](#div/safe)    [even?](#even)    [floor](#floor)    [gt?](#gt)    [gte?](#gte)    [heading/vector](#heading/vector)    [inc](#inc)    [inv](#inv)    [inv/0](#inv/0)    [inv/safe](#inv/safe)    [lt?](#lt)    [lte?](#lte)    [max](#max)    [min](#min)    [mod](#mod)    [mod/0](#mod/0)    [mod/safe](#mod/safe)    [mult](#mult)    [neg](#neg)    [neg?](#neg)    [odd?](#odd)    [pi](#pi)    [pos?](#pos)    [rad/deg](#rad/deg)    [rad/turn](#rad/turn)    [random](#random)    [random\_int](#random\_int)    [range](#range)    [round](#round)    [sin](#sin)    [sqrt](#sqrt)    [sqrt/safe](#sqrt/safe)    [square](#square)    [sub](#sub)    [sum\_of_squares](#sum\_of_squares)    [tan](#tan)    [tau](#tau)    [turn/deg](#turn/deg)    [turn/rad](#turn/rad)    [zero?](#zero) ### Results [err](#err)    [err?](#err)    [ok](#ok)    [ok?](#ok)    [unwrap!](#unwrap)    [unwrap\_or](#unwrap\_or) ### Sets -[any?](#any)    [append](#append)    [coll?](#coll)    [concat](#concat)    [count](#count)    [empty?](#empty)    [random](#random)    [set](#set)    [set?](#set) +[any?](#any)    [append](#append)    [coll?](#coll)    [concat](#concat)    [contains?](#contains)    [count](#count)    [empty?](#empty)    [omit](#omit)    [random](#random)    [set](#set)    [set?](#set) ### Strings [any?](#any)    [concat](#concat)    [count](#count)    [downcase](#downcase)    [empty?](#empty)    [join](#join)    [sentence](#sentence)    [show](#show)    [slice](#slice)    [split](#split)    [string](#string)    [string?](#string)    [strip](#strip)    [trim](#trim)    [upcase](#upcase)    [words](#words) +### Tuples +[any?](#any)    [at](#at)    [coll?](#coll)    [count](#count)    [empty?](#empty)    [first](#first)    [ordered?](#ordered)    [second](#second)    [tuple?](#tuple) + ### Turtle graphics [back!](#back)    [background!](#background)    [bk!](#bk)    [clear!](#clear)    [colors](#colors)    [fd!](#fd)    [forward!](#forward)    [goto!](#goto)    [heading](#heading)    [heading/vector](#heading/vector)    [home!](#home)    [left!](#left)    [lt!](#lt)    [pc!](#pc)    [pd!](#pd)    [pencolor](#pencolor)    [pencolor!](#pencolor)    [pendown!](#pendown)    [pendown?](#pendown)    [penup!](#penup)    [penwidth](#penwidth)    [penwidth!](#penwidth)    [position](#position)    [pu!](#pu)    [pw!](#pw)    [render\_turtle!](#render\_turtle)    [reset\_turtle!](#reset\_turtle)    [right!](#right)    [rt!](#rt)    [turtle\_state](#turtle\_state) ### Types and values -[assoc?](#assoc)    [bool?](#bool)    [coll?](#coll)    [dict?](#dict)    [eq?](#eq)    [fn?](#fn)    [keyword?](#keyword)    [list?](#list)    [neq?](#neq)    [nil?](#nil)    [number?](#number)    [ordered?](#ordered)    [show](#show)    [some](#some)    [some?](#some)    [string?](#string)    [type](#type) +[assoc?](#assoc)    [bool?](#bool)    [box?](#box)    [coll?](#coll)    [dict?](#dict)    [eq?](#eq)    [fn?](#fn)    [keyword?](#keyword)    [list?](#list)    [neq?](#neq)    [nil?](#nil)    [number?](#number)    [ordered?](#ordered)    [set?](#set)    [show](#show)    [some](#some)    [some?](#some)    [string?](#string)    [tuple?](#tuple)    [type](#type) ## All functions, alphabetically -[abs](#abs)    [add](#add)    [and](#and)    [angle](#angle)    [any?](#any)    [append](#append)    [assert!](#assert)    [assoc](#assoc)    [assoc?](#assoc)    [at](#at)    [atan/2](#atan/2)    [back!](#back)    [background!](#background)    [between?](#between)    [bg!](#bg)    [bgcolor](#bgcolor)    [bk!](#bk)    [bool](#bool)    [bool?](#bool)    [box?](#box)    [butlast](#butlast)    [ceil](#ceil)    [clear!](#clear)    [coll?](#coll)    [colors](#colors)    [concat](#concat)    [cos](#cos)    [count](#count)    [dec](#dec)    [deg/rad](#deg/rad)    [deg/turn](#deg/turn)    [dict](#dict)    [dict?](#dict)    [diff](#diff)    [dissoc](#dissoc)    [dist](#dist)    [div](#div)    [div/0](#div/0)    [div/safe](#div/safe)    [doc!](#doc)    [downcase](#downcase)    [each!](#each)    [empty?](#empty)    [eq?](#eq)    [err](#err)    [err?](#err)    [even?](#even)    [false?](#false)    [fd!](#fd)    [filter](#filter)    [first](#first)    [floor](#floor)    [fn?](#fn)    [fold](#fold)    [forward!](#forward)    [get](#get)    [goto!](#goto)    [gt?](#gt)    [gte?](#gte)    [heading](#heading)    [heading/vector](#heading/vector)    [home!](#home)    [inc](#inc)    [inv](#inv)    [inv/0](#inv/0)    [inv/safe](#inv/safe)    [join](#join)    [keep](#keep)    [keys](#keys)    [keyword?](#keyword)    [last](#last)    [left!](#left)    [list](#list)    [list?](#list)    [load\_turtle_state!](#load\_turtle_state)    [lt!](#lt)    [lt?](#lt)    [lte?](#lte)    [map](#map)    [max](#max)    [min](#min)    [mod](#mod)    [mult](#mult)    [neg](#neg)    [neg?](#neg)    [neq?](#neq)    [nil?](#nil)    [not](#not)    [odd?](#odd)    [ok](#ok)    [ok?](#ok)    [or](#or)    [ordered?](#ordered)    [p5\_calls](#p5\_calls)    [pc!](#pc)    [pd!](#pd)    [pencolor](#pencolor)    [pencolor!](#pencolor)    [pendown!](#pendown)    [pendown?](#pendown)    [penup!](#penup)    [penwidth](#penwidth)    [penwidth!](#penwidth)    [pi](#pi)    [pos?](#pos)    [position](#position)    [print!](#print)    [pu!](#pu)    [pw!](#pw)    [rad/deg](#rad/deg)    [rad/turn](#rad/turn)    [random](#random)    [random\_int](#random\_int)    [range](#range)    [render\_turtle!](#render\_turtle)    [report!](#report)    [reset\_turtle!](#reset\_turtle)    [rest](#rest)    [right!](#right)    [round](#round)    [rt!](#rt)    [second](#second)    [sentence](#sentence)    [set](#set)    [set?](#set)    [show](#show)    [sin](#sin)    [slice](#slice)    [some](#some)    [some?](#some)    [split](#split)    [square](#square)    [state](#state)    [store!](#store)    [string](#string)    [string?](#string)    [strip](#strip)    [sub](#sub)    [sum\_of_squares](#sum\_of_squares)    [tan](#tan)    [tau](#tau)    [trim](#trim)    [tuple?](#tuple)    [turn/deg](#turn/deg)    [turn/rad](#turn/rad)    [turtle\_commands](#turtle\_commands)    [turtle\_state](#turtle\_state)    [turtle\_states](#turtle\_states)    [type](#type)    [unbox](#unbox)    [unwrap!](#unwrap)    [unwrap\_or](#unwrap\_or)    [upcase](#upcase)    [update](#update)    [update!](#update)    [values](#values)    [words](#words)    [ws?](#ws)    [zero?](#zero) +[abs](#abs)    [add](#add)    [and](#and)    [angle](#angle)    [any?](#any)    [append](#append)    [assert!](#assert)    [assoc](#assoc)    [assoc?](#assoc)    [at](#at)    [atan/2](#atan/2)    [back!](#back)    [background!](#background)    [between?](#between)    [bg!](#bg)    [bgcolor](#bgcolor)    [bk!](#bk)    [bool](#bool)    [bool?](#bool)    [box?](#box)    [butlast](#butlast)    [ceil](#ceil)    [clear!](#clear)    [coll?](#coll)    [colors](#colors)    [concat](#concat)    [contains?](#contains)    [cos](#cos)    [count](#count)    [dec](#dec)    [deg/rad](#deg/rad)    [deg/turn](#deg/turn)    [dict](#dict)    [dict?](#dict)    [diff](#diff)    [dissoc](#dissoc)    [dist](#dist)    [div](#div)    [div/0](#div/0)    [div/safe](#div/safe)    [doc!](#doc)    [downcase](#downcase)    [each!](#each)    [empty?](#empty)    [eq?](#eq)    [err](#err)    [err?](#err)    [even?](#even)    [false?](#false)    [fd!](#fd)    [filter](#filter)    [first](#first)    [floor](#floor)    [fn?](#fn)    [fold](#fold)    [forward!](#forward)    [get](#get)    [goto!](#goto)    [gt?](#gt)    [gte?](#gte)    [heading](#heading)    [heading/vector](#heading/vector)    [home!](#home)    [inc](#inc)    [inv](#inv)    [inv/0](#inv/0)    [inv/safe](#inv/safe)    [join](#join)    [keep](#keep)    [keys](#keys)    [keyword?](#keyword)    [last](#last)    [left!](#left)    [list](#list)    [list?](#list)    [load\_turtle_state!](#load\_turtle_state)    [lt!](#lt)    [lt?](#lt)    [lte?](#lte)    [map](#map)    [max](#max)    [min](#min)    [mod](#mod)    [mod/0](#mod/0)    [mod/safe](#mod/safe)    [mult](#mult)    [neg](#neg)    [neg?](#neg)    [neq?](#neq)    [nil?](#nil)    [not](#not)    [odd?](#odd)    [ok](#ok)    [ok?](#ok)    [omit](#omit)    [or](#or)    [ordered?](#ordered)    [p5\_calls](#p5\_calls)    [pc!](#pc)    [pd!](#pd)    [pencolor](#pencolor)    [pencolor!](#pencolor)    [pendown!](#pendown)    [pendown?](#pendown)    [penup!](#penup)    [penwidth](#penwidth)    [penwidth!](#penwidth)    [pi](#pi)    [pos?](#pos)    [position](#position)    [print!](#print)    [pu!](#pu)    [pw!](#pw)    [rad/deg](#rad/deg)    [rad/turn](#rad/turn)    [random](#random)    [random\_int](#random\_int)    [range](#range)    [render\_turtle!](#render\_turtle)    [report!](#report)    [reset\_turtle!](#reset\_turtle)    [rest](#rest)    [right!](#right)    [round](#round)    [rt!](#rt)    [second](#second)    [sentence](#sentence)    [set](#set)    [set?](#set)    [show](#show)    [sin](#sin)    [slice](#slice)    [some](#some)    [some?](#some)    [split](#split)    [sqrt](#sqrt)    [sqrt/safe](#sqrt/safe)    [square](#square)    [state](#state)    [store!](#store)    [string](#string)    [string?](#string)    [strip](#strip)    [sub](#sub)    [sum\_of_squares](#sum\_of_squares)    [tan](#tan)    [tau](#tau)    [trim](#trim)    [tuple?](#tuple)    [turn/deg](#turn/deg)    [turn/rad](#turn/rad)    [turtle\_commands](#turtle\_commands)    [turtle\_state](#turtle\_state)    [turtle\_states](#turtle\_states)    [type](#type)    [unbox](#unbox)    [unwrap!](#unwrap)    [unwrap\_or](#unwrap\_or)    [upcase](#upcase)    [update](#update)    [update!](#update)    [values](#values)    [words](#words)    [ws?](#ws)    [zero?](#zero) ## Function documentation ---- + ### abs Returns the absolute value of a number. ``` @@ -84,7 +87,6 @@ Returns the absolute value of a number. ``` [Back to top.](#ludus-prelude-documentation) - --- ### add Adds numbers or vectors. @@ -97,7 +99,6 @@ Adds numbers or vectors. ``` [Back to top.](#ludus-prelude-documentation) - --- ### and Returns true if all values passed in are truthy. Note that this does not short-circuit: all arguments are evaulated before they are passed in. @@ -109,7 +110,6 @@ Returns true if all values passed in are truthy. Note that this does not short-c ``` [Back to top.](#ludus-prelude-documentation) - --- ### angle Calculates the angle between two vectors. @@ -118,7 +118,6 @@ Calculates the angle between two vectors. ``` [Back to top.](#ludus-prelude-documentation) - --- ### any? Returns true if something is not empty, otherwise returns false (including for things that can't be logically full, like numbers). @@ -132,7 +131,6 @@ Returns true if something is not empty, otherwise returns false (including for t ``` [Back to top.](#ludus-prelude-documentation) - --- ### append Adds an element to a list or set. @@ -145,7 +143,6 @@ Adds an element to a list or set. ``` [Back to top.](#ludus-prelude-documentation) - --- ### assert! Asserts a condition: returns the value if the value is truthy, panics if the value is falsy. Takes an optional message. @@ -155,7 +152,6 @@ Asserts a condition: returns the value if the value is truthy, panics if the val ``` [Back to top.](#ludus-prelude-documentation) - --- ### assoc Takes a dict, key, and value, and returns a new dict with the key set to value. @@ -167,7 +163,6 @@ Takes a dict, key, and value, and returns a new dict with the key set to value. ``` [Back to top.](#ludus-prelude-documentation) - --- ### assoc? Returns true if a value is an associative collection: a dict or a pkg. @@ -178,7 +173,6 @@ Returns true if a value is an associative collection: a dict or a pkg. ``` [Back to top.](#ludus-prelude-documentation) - --- ### at Returns the element at index n of a list or tuple, or the byte at index n of a string. Zero-indexed: the first element is at index 0. Returns nil if nothing is found in a list or tuple; returns an empty string if nothing is found in a string. @@ -190,7 +184,6 @@ Returns the element at index n of a list or tuple, or the byte at index n of a s ``` [Back to top.](#ludus-prelude-documentation) - --- ### atan/2 Returns an angle from a slope. Takes an optional keyword argument to specify units. Takes either two numbers or a vector tuple. @@ -204,7 +197,6 @@ Returns an angle from a slope. Takes an optional keyword argument to specify uni ``` [Back to top.](#ludus-prelude-documentation) - --- ### back! Moves the turtle backward by a number of steps. Alias: bk! @@ -213,7 +205,6 @@ Moves the turtle backward by a number of steps. Alias: bk! ``` [Back to top.](#ludus-prelude-documentation) - --- ### background! Sets the background color behind the turtle and path. Alias: bg! @@ -224,7 +215,6 @@ Sets the background color behind the turtle and path. Alias: bg! ``` [Back to top.](#ludus-prelude-documentation) - --- ### between? Returns true if a number is in the range [lower, higher): greater than or equal to the lower number, less than the higher. @@ -233,7 +223,6 @@ Returns true if a number is in the range [lower, higher): greater than or equal ``` [Back to top.](#ludus-prelude-documentation) - --- ### bg! Sets the background color behind the turtle and path. Alias: bg! @@ -244,12 +233,10 @@ Sets the background color behind the turtle and path. Alias: bg! ``` [Back to top.](#ludus-prelude-documentation) - --- ### bgcolor No documentation available. - --- ### bk! Moves the turtle backward by a number of steps. Alias: bk! @@ -258,7 +245,6 @@ Moves the turtle backward by a number of steps. Alias: bk! ``` [Back to top.](#ludus-prelude-documentation) - --- ### bool Returns false if a value is nil or false, otherwise returns true. @@ -269,7 +255,6 @@ Returns false if a value is nil or false, otherwise returns true. ``` [Back to top.](#ludus-prelude-documentation) - --- ### bool? Returns true if a value is of type :boolean. @@ -280,7 +265,6 @@ Returns true if a value is of type :boolean. ``` [Back to top.](#ludus-prelude-documentation) - --- ### box? Returns true if a value is a box. @@ -290,7 +274,6 @@ Returns true if a value is a box. ``` [Back to top.](#ludus-prelude-documentation) - --- ### butlast Returns a list, omitting the last element. @@ -299,7 +282,6 @@ Returns a list, omitting the last element. ``` [Back to top.](#ludus-prelude-documentation) - --- ### ceil Truncates a number towards positive infinity. With negative numbers, it returns the integer part. With positive numbers, returns the next more-positive integer. @@ -308,7 +290,6 @@ Truncates a number towards positive infinity. With negative numbers, it returns ``` [Back to top.](#ludus-prelude-documentation) - --- ### clear! Clears the canvas and sends the turtle home. @@ -317,26 +298,22 @@ Clears the canvas and sends the turtle home. ``` [Back to top.](#ludus-prelude-documentation) - --- ### coll? -Returns true if a value is a collection: dict, list, pkg, tuple, or set. +Returns true if a value is a collection: dict, list, tuple, or set. ``` (coll as :dict) (coll as :list) (coll as :tuple) (coll as :set) -(coll as :pkg) (_) ``` [Back to top.](#ludus-prelude-documentation) - --- ### colors No documentation available. - --- ### concat Combines two lists, strings, or sets. @@ -348,6 +325,14 @@ Combines two lists, strings, or sets. ``` [Back to top.](#ludus-prelude-documentation) +--- +### contains? +Returns true if a set or list contains a value. +``` +(value, set as :set) +(value, list as :list) +``` +[Back to top.](#ludus-prelude-documentation) --- ### cos @@ -360,7 +345,6 @@ Returns the cosine of an angle. Default angle measure is turns. An optional keyw ``` [Back to top.](#ludus-prelude-documentation) - --- ### count Returns the number of elements in a collection (including string). @@ -373,7 +357,6 @@ Returns the number of elements in a collection (including string). ``` [Back to top.](#ludus-prelude-documentation) - --- ### dec Decrements a number. @@ -382,7 +365,6 @@ Decrements a number. ``` [Back to top.](#ludus-prelude-documentation) - --- ### deg/rad Converts an angle in degrees to an angle in radians. @@ -391,7 +373,6 @@ Converts an angle in degrees to an angle in radians. ``` [Back to top.](#ludus-prelude-documentation) - --- ### deg/turn Converts an angle in degrees to an angle in turns. @@ -400,7 +381,6 @@ Converts an angle in degrees to an angle in turns. ``` [Back to top.](#ludus-prelude-documentation) - --- ### dict Takes a list or tuple of (key, value) tuples and returns it as a dict. Returns dicts unharmed. @@ -411,7 +391,6 @@ Takes a list or tuple of (key, value) tuples and returns it as a dict. Returns d ``` [Back to top.](#ludus-prelude-documentation) - --- ### dict? Returns true if a value is a dict. @@ -421,7 +400,6 @@ Returns true if a value is a dict. ``` [Back to top.](#ludus-prelude-documentation) - --- ### diff Takes two dicts and returns a dict describing their differences. Does this shallowly, offering diffs only for keys in the original dict. @@ -430,7 +408,6 @@ Takes two dicts and returns a dict describing their differences. Does this shall ``` [Back to top.](#ludus-prelude-documentation) - --- ### dissoc Takes a dict and a key, and returns a new dict with the key and associated value omitted. @@ -440,17 +417,15 @@ Takes a dict and a key, and returns a new dict with the key and associated value ``` [Back to top.](#ludus-prelude-documentation) - --- ### dist -Returns the distance from the origin to a point described by (x, y). +Returns the distance from the origin to a point described by x and y, or by the vector (x, y). ``` (x as :number, y as :number) ((x, y)) ``` [Back to top.](#ludus-prelude-documentation) - --- ### div Divides numbers. Panics on division by zero. @@ -462,7 +437,6 @@ Divides numbers. Panics on division by zero. ``` [Back to top.](#ludus-prelude-documentation) - --- ### div/0 Divides numbers. Returns 0 on division by zero. @@ -474,7 +448,6 @@ Divides numbers. Returns 0 on division by zero. ``` [Back to top.](#ludus-prelude-documentation) - --- ### div/safe Divides a number. Returns a result tuple. @@ -486,7 +459,6 @@ Divides a number. Returns a result tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### doc! Prints the documentation of a function to the console. @@ -496,7 +468,6 @@ Prints the documentation of a function to the console. ``` [Back to top.](#ludus-prelude-documentation) - --- ### downcase Takes a string and returns it in all lowercase. Works only for ascii characters. @@ -505,18 +476,16 @@ Takes a string and returns it in all lowercase. Works only for ascii characters. ``` [Back to top.](#ludus-prelude-documentation) - --- ### each! Takes a list and applies a function, presumably with side effects, to each element in the list. Returns nil. ``` (f! as :fn, []) (f! as :fn, [x]) -(f! as :fn, [...]) +(f! as :fn, [x, ...]) ``` [Back to top.](#ludus-prelude-documentation) - --- ### empty? Returns true if something is empty. Otherwise returns false (including for things that can't logically be empty, like numbers). @@ -530,7 +499,6 @@ Returns true if something is empty. Otherwise returns false (including for thing ``` [Back to top.](#ludus-prelude-documentation) - --- ### eq? Returns true if all arguments have the same value. @@ -541,7 +509,6 @@ Returns true if all arguments have the same value. ``` [Back to top.](#ludus-prelude-documentation) - --- ### err Takes a value and wraps it in an :err result tuple, presumably as an error message. @@ -550,7 +517,6 @@ Takes a value and wraps it in an :err result tuple, presumably as an error messa ``` [Back to top.](#ludus-prelude-documentation) - --- ### err? Takes a value and returns true if it is an :err result tuple. @@ -560,7 +526,6 @@ Takes a value and returns true if it is an :err result tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### even? Returns true if a value is an even number, otherwise returns false. @@ -570,7 +535,6 @@ Returns true if a value is an even number, otherwise returns false. ``` [Back to top.](#ludus-prelude-documentation) - --- ### false? Returns `true` if a value is `false`, otherwise returns `false`. Useful to distinguish between `false` and `nil`. @@ -580,7 +544,6 @@ Returns `true` if a value is `false`, otherwise returns `false`. Useful to disti ``` [Back to top.](#ludus-prelude-documentation) - --- ### fd! Moves the turtle forward by a number of steps. Alias: fd! @@ -589,7 +552,6 @@ Moves the turtle forward by a number of steps. Alias: fd! ``` [Back to top.](#ludus-prelude-documentation) - --- ### filter Takes a list and a predicate function, and returns a new list with only the items that produce truthy values when the function is called on them. E.g., `filter ([1, 2, 3, 4], odd?) &=> [1, 3]`. @@ -598,7 +560,6 @@ Takes a list and a predicate function, and returns a new list with only the item ``` [Back to top.](#ludus-prelude-documentation) - --- ### first Returns the first element of a list or tuple. @@ -607,7 +568,6 @@ Returns the first element of a list or tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### floor Truncates a number towards negative infinity. With positive numbers, it returns the integer part. With negative numbers, returns the next more-negative integer. @@ -616,7 +576,6 @@ Truncates a number towards negative infinity. With positive numbers, it returns ``` [Back to top.](#ludus-prelude-documentation) - --- ### fn? Returns true if an argument is a function. @@ -626,7 +585,6 @@ Returns true if an argument is a function. ``` [Back to top.](#ludus-prelude-documentation) - --- ### fold Folds a list. @@ -636,7 +594,6 @@ Folds a list. ``` [Back to top.](#ludus-prelude-documentation) - --- ### forward! Moves the turtle forward by a number of steps. Alias: fd! @@ -645,7 +602,6 @@ Moves the turtle forward by a number of steps. Alias: fd! ``` [Back to top.](#ludus-prelude-documentation) - --- ### get Takes a key, dict, and optional default value; returns the value at key. If the value is not found, returns nil or the default value. @@ -656,7 +612,6 @@ Takes a key, dict, and optional default value; returns the value at key. If the ``` [Back to top.](#ludus-prelude-documentation) - --- ### goto! Sends the turtle to (x, y) coordinates. If the pen is down, the turtle will draw a path to its new location. @@ -666,7 +621,6 @@ Sends the turtle to (x, y) coordinates. If the pen is down, the turtle will draw ``` [Back to top.](#ludus-prelude-documentation) - --- ### gt? Returns true if numbers are in decreasing order. @@ -677,7 +631,6 @@ Returns true if numbers are in decreasing order. ``` [Back to top.](#ludus-prelude-documentation) - --- ### gte? Returns true if numbers are in decreasing or flat order. @@ -688,7 +641,6 @@ Returns true if numbers are in decreasing or flat order. ``` [Back to top.](#ludus-prelude-documentation) - --- ### heading Returns the turtle's current heading. @@ -697,7 +649,6 @@ Returns the turtle's current heading. ``` [Back to top.](#ludus-prelude-documentation) - --- ### heading/vector Takes a turtle heading, and returns a unit vector of that heading. @@ -706,7 +657,6 @@ Takes a turtle heading, and returns a unit vector of that heading. ``` [Back to top.](#ludus-prelude-documentation) - --- ### home! Sends the turtle home: to the centre of the screen, pointing up. If the pen is down, the turtle will draw a path to home. @@ -715,7 +665,6 @@ Sends the turtle home: to the centre of the screen, pointing up. If the pen is d ``` [Back to top.](#ludus-prelude-documentation) - --- ### inc Increments a number. @@ -724,7 +673,6 @@ Increments a number. ``` [Back to top.](#ludus-prelude-documentation) - --- ### inv Returns the inverse of a number: 1/n or `div (1, n)`. Panics on division by zero. @@ -733,7 +681,6 @@ Returns the inverse of a number: 1/n or `div (1, n)`. Panics on division by zero ``` [Back to top.](#ludus-prelude-documentation) - --- ### inv/0 Returns the inverse of a number: 1/n or `div/0 (1, n)`. Returns 0 on division by zero. @@ -742,7 +689,6 @@ Returns the inverse of a number: 1/n or `div/0 (1, n)`. Returns 0 on division by ``` [Back to top.](#ludus-prelude-documentation) - --- ### inv/safe Returns the inverse of a number: 1/n or `div/safe (1, n)`. Returns a result tuple. @@ -751,7 +697,6 @@ Returns the inverse of a number: 1/n or `div/safe (1, n)`. Returns a result tupl ``` [Back to top.](#ludus-prelude-documentation) - --- ### join Takes a list of strings, and joins them into a single string, interposing an optional separator. @@ -759,12 +704,11 @@ Takes a list of strings, and joins them into a single string, interposing an opt ([]) ([str as :string]) (strs as :list) -([str], separator as :string) +([str as :string], separator as :string) ([str, ...], separator as :string) ``` [Back to top.](#ludus-prelude-documentation) - --- ### keep Takes a list and returns a new list with any `nil` values omitted. @@ -773,7 +717,6 @@ Takes a list and returns a new list with any `nil` values omitted. ``` [Back to top.](#ludus-prelude-documentation) - --- ### keys Takes a dict and returns a list of keys in that dict. @@ -782,7 +725,6 @@ Takes a dict and returns a list of keys in that dict. ``` [Back to top.](#ludus-prelude-documentation) - --- ### keyword? Returns true if a value is a keyword, otherwise returns false. @@ -792,7 +734,6 @@ Returns true if a value is a keyword, otherwise returns false. ``` [Back to top.](#ludus-prelude-documentation) - --- ### last Returns the last element of a list or tuple. @@ -801,7 +742,6 @@ Returns the last element of a list or tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### left! Rotates the turtle left, measured in turns. Alias: lt! @@ -810,16 +750,14 @@ Rotates the turtle left, measured in turns. Alias: lt! ``` [Back to top.](#ludus-prelude-documentation) - --- ### list -Takes a value and returns it as a list. For values, it simply wraps them in a list. For collections, conversions are as follows. A tuple->list conversion preservers order and length. Unordered collections do not preserve order. Associative collections return lists of (key, value) tuples. +Takes a value and returns it as a list. For values, it simply wraps them in a list. For collections, conversions are as follows. A tuple->list conversion preservers order and length. Unordered collections do not preserve order: sets and dicts don't have predictable or stable ordering in output. Dicts return lists of (key, value) tuples. ``` (x) ``` [Back to top.](#ludus-prelude-documentation) - --- ### list? Returns true if the value is a list. @@ -829,7 +767,6 @@ Returns true if the value is a list. ``` [Back to top.](#ludus-prelude-documentation) - --- ### load_turtle_state! Sets the turtle state to a previously saved state. Returns the state. @@ -838,7 +775,6 @@ Sets the turtle state to a previously saved state. Returns the state. ``` [Back to top.](#ludus-prelude-documentation) - --- ### lt! Rotates the turtle left, measured in turns. Alias: lt! @@ -847,7 +783,6 @@ Rotates the turtle left, measured in turns. Alias: lt! ``` [Back to top.](#ludus-prelude-documentation) - --- ### lt? Returns true if numbers are in increasing order. @@ -858,7 +793,6 @@ Returns true if numbers are in increasing order. ``` [Back to top.](#ludus-prelude-documentation) - --- ### lte? Returns true if numbers are in increasing or flat order. @@ -869,7 +803,6 @@ Returns true if numbers are in increasing or flat order. ``` [Back to top.](#ludus-prelude-documentation) - --- ### map Maps a function over a list: returns a new list with elements that are the result of applying the function to each element in the original list. E.g., `map ([1, 2, 3], inc) &=> [2, 3, 4]`. @@ -879,7 +812,6 @@ Maps a function over a list: returns a new list with elements that are the resul ``` [Back to top.](#ludus-prelude-documentation) - --- ### max Returns the number in its arguments that is closest to positive infinity. @@ -890,7 +822,6 @@ Returns the number in its arguments that is closest to positive infinity. ``` [Back to top.](#ludus-prelude-documentation) - --- ### min Returns the number in its arguments that is closest to negative infinity. @@ -901,15 +832,32 @@ Returns the number in its arguments that is closest to negative infinity. ``` [Back to top.](#ludus-prelude-documentation) - --- ### mod -Returns the modulus of num and div. Truncates towards negative infinity. +Returns the modulus of num and div. Truncates towards negative infinity. Panics if div is 0. ``` +(num as :number, 0) (num as :number, div as :number) ``` [Back to top.](#ludus-prelude-documentation) +--- +### mod/0 +Returns the modulus of num and div. Truncates towards negative infinity. Returns 0 if div is 0. +``` +(num as :number, 0) +(num as :number, div as :number) +``` +[Back to top.](#ludus-prelude-documentation) + +--- +### mod/safe +Returns the modulus of num and div in a result tuple, or an error if div is 0. Truncates towards negative infinity. +``` +(num as :number, 0) +(num as :number, div as :number) +``` +[Back to top.](#ludus-prelude-documentation) --- ### mult @@ -924,7 +872,6 @@ Multiplies numbers or vectors. ``` [Back to top.](#ludus-prelude-documentation) - --- ### neg Multiplies a number by -1, negating it. @@ -933,7 +880,6 @@ Multiplies a number by -1, negating it. ``` [Back to top.](#ludus-prelude-documentation) - --- ### neg? Returns true if a value is a negative number, otherwise returns false. @@ -943,7 +889,6 @@ Returns true if a value is a negative number, otherwise returns false. ``` [Back to top.](#ludus-prelude-documentation) - --- ### neq? Returns true if none of the arguments have the same value. @@ -954,7 +899,6 @@ Returns true if none of the arguments have the same value. ``` [Back to top.](#ludus-prelude-documentation) - --- ### nil? Returns true if a value is nil. @@ -964,7 +908,6 @@ Returns true if a value is nil. ``` [Back to top.](#ludus-prelude-documentation) - --- ### not Returns false if a value is truthy, true if a value is falsy. @@ -975,7 +918,6 @@ Returns false if a value is truthy, true if a value is falsy. ``` [Back to top.](#ludus-prelude-documentation) - --- ### odd? Returns true if a value is an odd number, otherwise returns false. @@ -985,7 +927,6 @@ Returns true if a value is an odd number, otherwise returns false. ``` [Back to top.](#ludus-prelude-documentation) - --- ### ok Takes a value and wraps it in an :ok result tuple. @@ -994,7 +935,6 @@ Takes a value and wraps it in an :ok result tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### ok? Takes a value and returns true if it is an :ok result tuple. @@ -1004,6 +944,13 @@ Takes a value and returns true if it is an :ok result tuple. ``` [Back to top.](#ludus-prelude-documentation) +--- +### omit +Returns a new set with the value omitted. +``` +(value, s as :set) +``` +[Back to top.](#ludus-prelude-documentation) --- ### or @@ -1016,7 +963,6 @@ Returns true if any value passed in is truthy. Note that this does not short-cir ``` [Back to top.](#ludus-prelude-documentation) - --- ### ordered? Returns true if a value is an indexed collection: list or tuple. @@ -1027,12 +973,10 @@ Returns true if a value is an indexed collection: list or tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### p5_calls No documentation available. - --- ### pc! Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or an rgba tuple. Alias: pc! @@ -1043,7 +987,6 @@ Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or ``` [Back to top.](#ludus-prelude-documentation) - --- ### pd! Lowers the turtle's pen, causing it to draw. Alias: pd! @@ -1052,7 +995,6 @@ Lowers the turtle's pen, causing it to draw. Alias: pd! ``` [Back to top.](#ludus-prelude-documentation) - --- ### pencolor Returns the turtle's pen color as an (r, g, b, a) tuple. @@ -1061,7 +1003,6 @@ Returns the turtle's pen color as an (r, g, b, a) tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### pencolor! Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or an rgba tuple. Alias: pc! @@ -1072,7 +1013,6 @@ Changes the turtle's pen color. Takes a single grayscale value, an rgb tuple, or ``` [Back to top.](#ludus-prelude-documentation) - --- ### pendown! Lowers the turtle's pen, causing it to draw. Alias: pd! @@ -1081,7 +1021,6 @@ Lowers the turtle's pen, causing it to draw. Alias: pd! ``` [Back to top.](#ludus-prelude-documentation) - --- ### pendown? Returns the turtle's pen state: true if the pen is down. @@ -1090,7 +1029,6 @@ Returns the turtle's pen state: true if the pen is down. ``` [Back to top.](#ludus-prelude-documentation) - --- ### penup! Lifts the turtle's pen, stopping it from drawing. Alias: pu! @@ -1099,7 +1037,6 @@ Lifts the turtle's pen, stopping it from drawing. Alias: pu! ``` [Back to top.](#ludus-prelude-documentation) - --- ### penwidth Returns the turtle's pen width in pixels. @@ -1108,7 +1045,6 @@ Returns the turtle's pen width in pixels. ``` [Back to top.](#ludus-prelude-documentation) - --- ### penwidth! Sets the width of the turtle's pen, measured in pixels. Alias: pw! @@ -1117,12 +1053,10 @@ Sets the width of the turtle's pen, measured in pixels. Alias: pw! ``` [Back to top.](#ludus-prelude-documentation) - --- ### pi No documentation available. - --- ### pos? Returns true if a value is a positive number, otherwise returns false. @@ -1132,7 +1066,6 @@ Returns true if a value is a positive number, otherwise returns false. ``` [Back to top.](#ludus-prelude-documentation) - --- ### position Returns the turtle's current position. @@ -1141,7 +1074,6 @@ Returns the turtle's current position. ``` [Back to top.](#ludus-prelude-documentation) - --- ### print! Sends a text representation of Ludus values to the console. @@ -1150,7 +1082,6 @@ Sends a text representation of Ludus values to the console. ``` [Back to top.](#ludus-prelude-documentation) - --- ### pu! Lifts the turtle's pen, stopping it from drawing. Alias: pu! @@ -1159,7 +1090,6 @@ Lifts the turtle's pen, stopping it from drawing. Alias: pu! ``` [Back to top.](#ludus-prelude-documentation) - --- ### pw! Sets the width of the turtle's pen, measured in pixels. Alias: pw! @@ -1168,7 +1098,6 @@ Sets the width of the turtle's pen, measured in pixels. Alias: pw! ``` [Back to top.](#ludus-prelude-documentation) - --- ### rad/deg Converts an angle in radians to an angle in degrees. @@ -1177,7 +1106,6 @@ Converts an angle in radians to an angle in degrees. ``` [Back to top.](#ludus-prelude-documentation) - --- ### rad/turn Converts an angle in radians to an angle in turns. @@ -1186,20 +1114,19 @@ Converts an angle in radians to an angle in turns. ``` [Back to top.](#ludus-prelude-documentation) - --- ### random -Returns a random number. With zero arguments, returns a random number between 0 (inclusive) and 1 (exclusive). With one argument, returns a random number between 0 and n. With two arguments, returns a random number between m and n. Alternately, given a list, it returns a random member of that list. +Returns a random something. With zero arguments, returns a random number between 0 (inclusive) and 1 (exclusive). With one argument, returns a random number between 0 and n. With two arguments, returns a random number between m and n. Alternately, given a collection (list, dict, set), it returns a random member of that collection. ``` () (n as :number) (m as :number, n as :number) (l as :list) (d as :dict) +(s as :set) ``` [Back to top.](#ludus-prelude-documentation) - --- ### random_int Returns a random integer. With one argument, returns a random integer between 0 and that number. With two arguments, returns a random integer between them. @@ -1209,7 +1136,6 @@ Returns a random integer. With one argument, returns a random integer between 0 ``` [Back to top.](#ludus-prelude-documentation) - --- ### range Returns the set of integers between start (inclusive) and end (exclusive) as a list: [start, end). With one argument, starts at 0. If end is less than start, returns an empty list. @@ -1219,7 +1145,6 @@ Returns the set of integers between start (inclusive) and end (exclusive) as a l ``` [Back to top.](#ludus-prelude-documentation) - --- ### render_turtle! No docstring available. @@ -1228,7 +1153,6 @@ No docstring available. ``` [Back to top.](#ludus-prelude-documentation) - --- ### report! Prints a value, then returns it. @@ -1238,7 +1162,6 @@ Prints a value, then returns it. ``` [Back to top.](#ludus-prelude-documentation) - --- ### reset_turtle! Resets the turtle to its original state. @@ -1247,7 +1170,6 @@ Resets the turtle to its original state. ``` [Back to top.](#ludus-prelude-documentation) - --- ### rest Returns all but the first element of a list or tuple, as a list. @@ -1257,7 +1179,6 @@ Returns all but the first element of a list or tuple, as a list. ``` [Back to top.](#ludus-prelude-documentation) - --- ### right! Rotates the turtle right, measured in turns. Alias: rt! @@ -1266,7 +1187,6 @@ Rotates the turtle right, measured in turns. Alias: rt! ``` [Back to top.](#ludus-prelude-documentation) - --- ### round Rounds a number to the nearest integer. @@ -1275,7 +1195,6 @@ Rounds a number to the nearest integer. ``` [Back to top.](#ludus-prelude-documentation) - --- ### rt! Rotates the turtle right, measured in turns. Alias: rt! @@ -1284,7 +1203,6 @@ Rotates the turtle right, measured in turns. Alias: rt! ``` [Back to top.](#ludus-prelude-documentation) - --- ### second Returns the second element of a list or tuple. @@ -1293,7 +1211,6 @@ Returns the second element of a list or tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### sentence Takes a list of words and turns it into a sentence. @@ -1302,7 +1219,6 @@ Takes a list of words and turns it into a sentence. ``` [Back to top.](#ludus-prelude-documentation) - --- ### set Takes an ordered collection--list or tuple--and turns it into a set. @@ -1312,7 +1228,6 @@ Takes an ordered collection--list or tuple--and turns it into a set. ``` [Back to top.](#ludus-prelude-documentation) - --- ### set? Returns true if a value is a set. @@ -1322,7 +1237,6 @@ Returns true if a value is a set. ``` [Back to top.](#ludus-prelude-documentation) - --- ### show Returns a text representation of a Ludus value as a string. @@ -1331,7 +1245,6 @@ Returns a text representation of a Ludus value as a string. ``` [Back to top.](#ludus-prelude-documentation) - --- ### sin Returns the sine of an angle. Default angle measure is turns. An optional keyword argument specifies the units of the angle passed in. @@ -1343,7 +1256,6 @@ Returns the sine of an angle. Default angle measure is turns. An optional keywor ``` [Back to top.](#ludus-prelude-documentation) - --- ### slice Returns a slice of a list, representing a sub-list. @@ -1355,7 +1267,6 @@ Returns a slice of a list, representing a sub-list. ``` [Back to top.](#ludus-prelude-documentation) - --- ### some Takes a possibly nil value and a default value. Returns the value if it's not nil, returns the default if it's nil. @@ -1365,7 +1276,6 @@ Takes a possibly nil value and a default value. Returns the value if it's not ni ``` [Back to top.](#ludus-prelude-documentation) - --- ### some? Returns true if a value is not nil. @@ -1375,7 +1285,6 @@ Returns true if a value is not nil. ``` [Back to top.](#ludus-prelude-documentation) - --- ### split Takes a string, and turns it into a list of strings, breaking on the separator. @@ -1384,6 +1293,21 @@ Takes a string, and turns it into a list of strings, breaking on the separator. ``` [Back to top.](#ludus-prelude-documentation) +--- +### sqrt +Returns the square root of a number. Panics if the number is negative. +``` +(x as :number) +``` +[Back to top.](#ludus-prelude-documentation) + +--- +### sqrt/safe +Returns a result containing the square root of a number, or an error if the number is negative. +``` +(x as :number) +``` +[Back to top.](#ludus-prelude-documentation) --- ### square @@ -1393,12 +1317,10 @@ Squares a number. ``` [Back to top.](#ludus-prelude-documentation) - --- ### state No documentation available. - --- ### store! Stores a value in a box, replacing the value that was previously there. Returns the value. @@ -1407,7 +1329,6 @@ Stores a value in a box, replacing the value that was previously there. Returns ``` [Back to top.](#ludus-prelude-documentation) - --- ### string Converts a value to a string by using `show`. If it is a string, returns it unharmed. Use this to build up strings of different kinds of values. @@ -1418,7 +1339,6 @@ Converts a value to a string by using `show`. If it is a string, returns it unha ``` [Back to top.](#ludus-prelude-documentation) - --- ### string? Returns true if a value is a string. @@ -1428,7 +1348,6 @@ Returns true if a value is a string. ``` [Back to top.](#ludus-prelude-documentation) - --- ### strip Removes punctuation from a string, removing all instances of ,.;:?! @@ -1443,7 +1362,6 @@ Removes punctuation from a string, removing all instances of ,.;:?! ``` [Back to top.](#ludus-prelude-documentation) - --- ### sub Subtracts numbers or vectors. @@ -1456,7 +1374,6 @@ Subtracts numbers or vectors. ``` [Back to top.](#ludus-prelude-documentation) - --- ### sum_of_squares Returns the sum of squares of numbers. @@ -1468,7 +1385,6 @@ Returns the sum of squares of numbers. ``` [Back to top.](#ludus-prelude-documentation) - --- ### tan Returns the sine of an angle. Default angle measure is turns. An optional keyword argument specifies the units of the angle passed in. @@ -1480,12 +1396,10 @@ Returns the sine of an angle. Default angle measure is turns. An optional keywor ``` [Back to top.](#ludus-prelude-documentation) - --- ### tau No documentation available. - --- ### trim Trims whitespace from a string. Takes an optional argument, `:left` or `:right`, to trim only on the left or right. @@ -1496,7 +1410,6 @@ Trims whitespace from a string. Takes an optional argument, `:left` or `:right`, ``` [Back to top.](#ludus-prelude-documentation) - --- ### tuple? Returns true if a value is a tuple. @@ -1506,7 +1419,6 @@ Returns true if a value is a tuple. ``` [Back to top.](#ludus-prelude-documentation) - --- ### turn/deg Converts an angle in turns to an angle in degrees. @@ -1515,7 +1427,6 @@ Converts an angle in turns to an angle in degrees. ``` [Back to top.](#ludus-prelude-documentation) - --- ### turn/rad Converts an angle in turns to an angle in radians. @@ -1524,12 +1435,10 @@ Converts an angle in turns to an angle in radians. ``` [Back to top.](#ludus-prelude-documentation) - --- ### turtle_commands No documentation available. - --- ### turtle_state Returns the turtle's current state. @@ -1538,12 +1447,10 @@ Returns the turtle's current state. ``` [Back to top.](#ludus-prelude-documentation) - --- ### turtle_states No documentation available. - --- ### type Returns a keyword representing the type of the value passed in. @@ -1552,7 +1459,6 @@ Returns a keyword representing the type of the value passed in. ``` [Back to top.](#ludus-prelude-documentation) - --- ### unbox Returns the value that is stored in a box. @@ -1561,7 +1467,6 @@ Returns the value that is stored in a box. ``` [Back to top.](#ludus-prelude-documentation) - --- ### unwrap! Takes a result tuple. If it's :ok, then returns the value. If it's not :ok, then it panics. If it's not a result tuple, it also panics. @@ -1572,7 +1477,6 @@ Takes a result tuple. If it's :ok, then returns the value. If it's not :ok, then ``` [Back to top.](#ludus-prelude-documentation) - --- ### unwrap_or Takes a value that is a result tuple and a default value. If it's :ok, then it returns the value. If it's :err, returns the default value. @@ -1582,7 +1486,6 @@ Takes a value that is a result tuple and a default value. If it's :ok, then it r ``` [Back to top.](#ludus-prelude-documentation) - --- ### upcase Takes a string and returns it in all uppercase. Works only for ascii characters. @@ -1591,7 +1494,6 @@ Takes a string and returns it in all uppercase. Works only for ascii characters. ``` [Back to top.](#ludus-prelude-documentation) - --- ### update Takes a dict, key, and function, and returns a new dict with the key set to the result of applying the function to original value held at the key. @@ -1601,7 +1503,6 @@ Takes a dict, key, and function, and returns a new dict with the key set to the ``` [Back to top.](#ludus-prelude-documentation) - --- ### update! Updates a box by applying a function to its value. Returns the new value. @@ -1610,7 +1511,6 @@ Updates a box by applying a function to its value. Returns the new value. ``` [Back to top.](#ludus-prelude-documentation) - --- ### values Takes a dict and returns a list of values in that dict. @@ -1619,7 +1519,6 @@ Takes a dict and returns a list of values in that dict. ``` [Back to top.](#ludus-prelude-documentation) - --- ### words Takes a string and returns a list of the words in the string. Strips all whitespace. @@ -1628,7 +1527,6 @@ Takes a string and returns a list of the words in the string. Strips all whitesp ``` [Back to top.](#ludus-prelude-documentation) - --- ### ws? Tells if a string is a whitespace character. @@ -1640,7 +1538,6 @@ Tells if a string is a whitespace character. ``` [Back to top.](#ludus-prelude-documentation) - --- ### zero? Returns true if a number is 0.