<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>82993</integer>
    </number>
    <user>
      <string>???</string>
    </user>
    <title>
      <string>untitled</string>
    </title>
    <contents>
      <string>(defun compose (&amp;rest fns) 
  (destructuring-bind (fn1 . rest) (reverse fns)
    #'(lambda (&amp;rest args)
	(reduce #'(lambda (v f) (funcall f v))
		rest
		:initial-value (apply fn1 args)))))

(defun compose (&amp;rest fns) 
  &quot;Compose takes a number of functions and returns their composition&quot;
  (destructuring-bind (fn1 . rest) (reverse fns) ; destructuring-bind is a generalized form of let, 
					;it takes a lambda list tree and a list/tree and binds the variables specified in it
					;the same could have been done using let and car/cdr to access the list
    #'(lambda (&amp;rest args) ; the composed function is returned, it takes any number of arguments
	(reduce #'(lambda (v f) (funcall f v)); reducing is done by taking a value and a function and applying the function to the value
		rest ; rest represents the remaining functions to be composed (in reverse order)
		:initial-value (apply fn1 args))))) ; the first value which is passed 
					;to the reduce function is the result of applying
					;given arguments to the first function
					;All but the first function take a single argument
</string>
    </contents>
    <universal-time>
      <integer>3455675748</integer>
    </universal-time>
    <channel>
      <string>None</string>
    </channel>
    <colorization-mode>
      <string>Common Lisp</string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <keyword>TRUE</keyword>
    </is-unicode>
    <deletion-requested>
      <null/>
    </deletion-requested>
    <deletion-requested-email>
      <null/>
    </deletion-requested-email>
    <expiration-time>
      <null/>
    </expiration-time>
  </paste>
</paste-with-annotations>
