Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct ExpressionThunk
source::Any
thunk::Any
end
macro thunk(e)
quote
ExpressionThunk(
$(QuoteNode(e)),
() -> $(esc(e))
)
end
end
x = 1
t = let y = 2
@thunk(x + y)
end
t.source
t.thunk()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment