Functions to know for the midterm Lists ------ list - takes all arguments and makes a list out of them cons - takes an element and a list as arguments. inserts the element as the first element in the list append - takes 2 lists as arguments and makes them into one big list car - takes a list as an argument and returns the first element cdr - takes a list as an argument and returns all but the first element at a new list c..a...d...a..d....r - applies car and cdr in the order of indicating letters in the function call null? - takes a list an tells whether it is eaqual to '() map - takes a function (that takes 1 argument) and a list and applies the function to each element in the list accumulate - takes a function (which takes 2 arguments) and applies it to combine the elements into one final value length - takes a list and returns the number of elements General Syntax -------------- operators +, -, *, etc remainder - returns the remainder of the first argument divided by the second if, cond - for control flow equal? - compares most types for equality random - takes a number n and returns a random number between 0 and n |