title: Returning a function from a function in OZ. Higher order problems
body: <p>I am trying to write a function that will essentially return a function as a result. I am trying to achieve something like this: </p>
  
  <pre><code>{{Add 3}4}
  </code></pre>
  
  <p>where the result will come out as 7. I found the following <a href="https://stackoverflow.com/questions/14316965/how-to-write-a-simple-higher-order-function-in-mozart-oz">SO question</a> that has the same question, but the answer did not work for me. I receive "Variable Adder not Introduced". I have tried declaring it locally, and also setting a variable equal to it, but as of yet, I have not gotten anything to work. I know what I want to do; I want to return a function that has been decorated by an outer function. Unfortunately, I can't find anything solid in the documentation on how to do that. Here is what I've been trying, based on the online docs. </p>
  
  <pre><code>declare
  local
     proc {And M ?B}
        if M &gt; 0 then B = M else B = 0 end
     end
  in
     proc {Add2 J ?B}
       J +  {And}
     end
  end
  </code></pre>
  
  <p>When I call</p>
  
  <pre><code>{{Browse {Add2 1}2}
  </code></pre>
  
  <p>I'm hoping to get 3. What I actually get is a compilation with no errors, that doesn't actually browse to anything. 
  I know this isn't what I'm looking for, but it's all i've got so far. I want to take J, and add it to the result of calling whatever is left out there. Can anyone point the way?</p>
  
  <p>Thanks,</p>