title: SIGABRT when trying to evaluate an NSExpression or NSPredicate
body: <p>I'm trying to combine <a href="https://nshipster.com/nsexpression/" rel="nofollow noreferrer">NSExpression</a> + <a href="https://nshipster.com/nspredicate/" rel="nofollow noreferrer">NSPredicate</a> to create a simple feature where the user will type something like <code>size + 1 &gt; 3</code> and it will evaluate the expression.</p>
  <p>First, to make sure I can get NSExpression to work with a variable, I tried the following:</p>
  <pre><code>NSExpression(format: &quot;2 + 1&quot;)
    .expressionValue(with: nil, context: nil)
  // == 3
  
  NSExpression(format: &quot;myInt + 1&quot;)
    .expressionValue(with: [&quot;myInt&quot;: 2], context: nil)
  // == 3
  </code></pre>
  <p>Next, to make sure I can evaluate a NSPredicate, I tried the following:</p>
  <pre><code>NSPredicate(format: &quot;2 + 1 == 3&quot;)
    .evaluate(with: nil)
  // == true
  </code></pre>
  <p>Now when I try to combine the two, I get <code>error: Execution was interrupted, reason: signal SIGABRT.</code>, no matter which combination I try:</p>
  <pre><code>NSPredicate(format: &quot;size + 1 == 3&quot;)
    .evaluate(with: [&quot;size&quot;: 2])
  // error: Execution was interrupted, reason: signal SIGABRT.
  
  NSPredicate(format: &quot;$size + 1 == 3&quot;)
    .evaluate(with: [&quot;size&quot;: 2])
  // error: Execution was interrupted, reason: signal SIGABRT.
  
  NSPredicate(format: &quot;size + 1 == 3&quot;)
    .withSubstitutionVariables([&quot;size&quot;: 2])
    .evaluate(with: nil)
  // error: Execution was interrupted, reason: signal SIGABRT.
  
  NSPredicate(format: &quot;$size + 1 == 3&quot;)
    .withSubstitutionVariables([&quot;size&quot;: 2])
    .evaluate(with: nil)
  // error: Execution was interrupted, reason: signal SIGABRT.
  </code></pre>
  <p>I know that most NSPredicate's are used to filter lists, which make me wonder if a use-case such as the above could even work.</p>
  <p>Is it possible to use a variable in an NSPredicate that is evaluated one-time?</p>