#lang racket ; given an associative operator op, and ; a list (e1 e2 e3 ... en) ; compute the list ; e1, e1 op e2, e1 op e2 op e3, ..., e1 op e2 op ... op en ; what does this function construct as it recurses? ; this function is not tail recursive. Why? (define prefix-list (lambda (op L) (if (null? (rest L)) L (cons (first L) (map (lambda (x)(op (first L) x) ) (prefix-list op (rest L)) ) ) ) ) ) ;(prefix-list + '(1)) ;(prefix-list + '(1 2 3 4 5))