Skip to content

Instantly share code, notes, and snippets.

@exts
Created Sep 25, 2017
Embed
What would you like to do?
class Test
@stored = [] of Proc(Nil)
def captured(&block)
@stored << block
end
def example
@stored.each do |b|
b.call()
end
end
# macro capture(&block)
# captured {{block}}
# end
end
# t = Test.new
# t.captured do
# puts "sup"
# end
# t.captured do
# puts "sup again"
# end
# t.example
# # what I want to do w/ macro
# class Derived < Test
# capture do
# end
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment