Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using Cassette
Cassette.@context FizzBuzzCtx
function Cassette.overdub(ctx::FizzBuzzCtx, ::typeof(string), i::Integer)
if i % 3 == 0
if i % 5 == 0
"fizzbuzz"
else
"fizz"
end
else
if i % 5 == 0
"buzz"
else
string(i)
end
end
end
function printnums(n)
for i = 1:n
println(i)
end
end
Cassette.overdub(FizzBuzzCtx(), printnums, 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment