Arc Forumnew | comments | leaders | submitlogin
1 point by Jesin 6087 days ago | link | parent

I looked at arc.arc, and since this is the definition of while:

  (mac while (test . body)
    (w/uniq (gf gp)
      `((rfn ,gf (,gp)
          (when ,gp ,@body (,gf ,test)))
        ,test)))
I figured this would work for dowhile:

  (mac dowhile (test . body)
    (w/uniq (gf gp)
      `((rfn ,gf (,gp)
          (when ,gp ,@body (,gf ,test)))
        t)))
I just replaced the first test that would be evaluated with t, while leaving subsequent tests alone. But yes, I agree that it's strange that Arc has until but not dowhile.