20-CS-4003-001 Organization of Programming Languages Fall 2017
Basic Operations

Lambda calculus, Type theory, Formal semantics, Program analysis

    Prev     Next     All lectures        Code

Find maximum number in a list

 
(define findmax
  (lambda (lst)
    (if (null? lst)
        '()
        (if (null? (cdr lst))
            (car lst)
            (max (car lst)
                 (findmax (cdr lst)))))))
 -  Returns a number or empty list!!