Skip to content

Instantly share code, notes, and snippets.

@konfou
Last active March 18, 2021 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konfou/a95e6b680b8261ae35fa2bd27a255aa1 to your computer and use it in GitHub Desktop.
Save konfou/a95e6b680b8261ae35fa2bd27a255aa1 to your computer and use it in GitHub Desktop.
"""
@do begin
body
end when condition
Macro emulating a do-until construct.
"""
@eval macro $(:do)(body, when::Symbol, condition)
quote
while true
$body
if $condition break; end;
end
end |> esc
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment