News for hackers. Stuff that matters.
Re:Confess HN: Share your Immoral Hacks, Codes or Tweaks by arketyp on Friday July 31, 2009 @07:20AM (#734164)
Pardon my presumed ignorance, but how is that?
Re:Confess HN: Share your Immoral Hacks, Codes or Tweaks by jrockway on Friday July 31, 2009 @08:17AM (#734227)
You implement your loop macro such that it binds some variable to a continuation, that when invoked, exits the loop. Then when you want to exit the loop, you invoke the continuation.

(Loop exits, exceptions, returns from functions, etc. are all special cases of continuations.)

This is an improvement over something like Perl's "last LABEL" statement, because you can pass the continuation around and exit the loop from anywhere you desire.