;; CSE 413 19wi Lecture 1 ;; DrRacket interactions window demo Welcome to DrRacket, version 7.1 [3m]. Language: racket, with debugging; memory limit: 128 MB. > 17 17 > (+ 1 2) 3 > (+ 3 6 2 8 6 9) 34 > + # > (+ (* 3 4) (- 5 3)) 14 > (define magic 42) > magic 42 > (/ magic 2) 21 > spell . . spell: undefined; cannot reference an identifier before its definition > (define xvii (+ 16 1)) > xvii 17 > (* xvii magic) 714 > (define (twice n) (* 2 n)) > twice # > (twice 21) 42 > (- (twice 21) 10) 32 > (twice (* 3 2)) 12 > (define (fact n) (if (< n 2) 1 (* n (fact (- n 1))))) > (fact 0) 1 > (fact 1) 1 > (fact 2) 2 > (fact 3) 6 > (fact 5) 120 > (fact 10) 3628800 > (fact 100) 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 > (fact 99) 933262154439441526816992388562667004907159682643816214685929638952175999932299156089414639761565182862536979208272237582511852109168640000000000000000000000 > (< 1 2) #t > (< 2 1) #f > (< 1 1) #f > (> magic xvii) #t > (twice 12) 24 > (define double (lambda (n) (* 2 n))) > (double 12) 24 > (lambda (x y) (* x y)) # > ((lambda (x y) (- x y)) 4 3) 1 >