title: Creating a Function that produces a Function Scheme/DrRacket
body: <p>I'm working on a function that takes in a list of structures and then using that list of structures produces a function that processes a list of symbols into a number. Each structure is made up of a symbol, that will be in the second list consumed, and a number. This function produced has to turn the list of symbols into a number by assigning each symbol a value based on the previous structures. Using abstract list functions btw.</p>
  
  <pre><code>    Example: ((function (list (make-value 'value1 10) (make-value 'value2 20)))
                (list 'value1 'value2 'nothing 'value1)) would produced 40.
  </code></pre>
  
  <p>Heres my code but it only works for specific cases.</p>
  
  <pre><code> (define (function lst)
     (lambda (x) (foldr + 0 (map (lambda (x) 
                             (cond
                               [(equal? x (value-name(first lst)))(value-value (first  lst))]
                               [else (value-value (second lst))]))
  
                               (filter (lambda (x) (member? x (map value-name lst)))x)))))
  </code></pre>