title: Error while returning output of Pig macro via tuple
body: <p>The error is in the function below, I'm trying to generate 2 measures of entropy (the latter removes all events with &lt;5 frequency).</p>
  
  <p>My error:  </p>
  
  <blockquote>
    <p>ERROR 1200: Cannot expand macro 'TOTUPLE'. Reason: Macro must be defined before expansion.</p>
  </blockquote>
  
  <p>Which is weird, because TOTUPLE is a built-in function. Other pig scripts use TOTUPLE with no problems.</p>
  
  <p>Code:  </p>
  
  <pre><code>define dual_entropies (search, field) returns entropies {  
    summary = summary_total($search, $field);  
    entr1 = count_sum_entropy(summary, $field);  
    summary = filter summary by events &gt;= 5L;  
    entr2 = count_sum_entropy(summary, $field);  
    $entropies = TOTUPLE(entr1, entr2);  
  };
  </code></pre>
  
  <p>Note that entr1 and entr2 are both single numbers, not vectors of numbers - I suspect that's part of the issue.</p>