; recap from last time (about lists) (define list1 '(a b)) (define list2 '(1 2)) ; what do the following commands return (append list1 list2) ; can take in any number of lists and will stick them together (cons list1 list2) ; cons expects two arguments, an item of any kinds and a list and it makes ; that item the new first element of the list (list list1 list2) ; list can take any number of arguments and make a new list to put them in ; PROCEDURES (functions) ; when writing a procedure, we use the LAMBDA command to bind ; values to variables ; syntax: (lambda VARIABLE-LIST EXPRESSION) (lambda (a b) (+ a b)) ;example (define add (lambda (a b) (+ a b))) ; Given: A, B positive integers ; Result: MULTIPLE-OF? a boolean value (#t or #f) ; Precondition: none ; Result: MULTIPLE-OF? is #t if and only if A is a multiple of B (define multiple-of? (lambda (a b) (= 0 (remainder a b))))