Arc Forumnew | comments | leaders | submitlogin
1 point by sjs 6161 days ago | link | parent

I was thinking the same thing this morning actually. Probably not something common enough to warrant wrapping every loop. I like the breakable idea of yours.


2 points by almkglor 6161 days ago | link

Could be implemented. I'm in the office right now so I can't use arc here (mandatory windows pc, not to mention a shared internet terminal); it would be possible to just add it into arc.arc, although with a seriously good docstring.

  (mac breakable (expr)
    " Creates a control structure which can be exited by
      calling `break' with a value to be returned.  To
      use, add `breakable:' before the control structure,
      e.g. (breakable:while t (aif (something) (break it)))
      See also [[catch]] [[point]] [[compose]] [[while]] "
      `(point break ,expr))

-----