title: Return from a nested loop in Common Lisp
body: <p>I'm trying to convert this Python code into Common Lisp:</p>
  
  <pre><code>for a in xrange(1,1000):
      for b in xrange(a,1000):
          c = (a**2 + b**2) ** 0.5
          s = a + b + c
          if s == 1000:
              return a * b * c
  </code></pre>
  
  <p>My first attempt was:</p>
  
  <pre><code>(loop for a from 1 to 999
        do (loop for b from a to 999
                 for c = (sqrt (+ (expt a 2) (expt b 2)))
                 for s = (+ a b c)
                 until (= s 1000)
                 finally return (* a b c))))
  </code></pre>
  
  <p>This doesn't work. My task is: when <code>s</code> hits 1000 make the whole expression above return <code>(* a b c)</code>. How to return some value from a nested loop macro?</p>