Skip to content

Instantly share code, notes, and snippets.

@tk3369
Created February 17, 2018 18:57
Show Gist options
  • Save tk3369/1de6a0dc757ccb217aadbaa7dd87d27b to your computer and use it in GitHub Desktop.
Save tk3369/1de6a0dc757ccb217aadbaa7dd87d27b to your computer and use it in GitHub Desktop.
"""
Print a subtype tree from the specified `roottype`
"""
function subtypetree(roottype, level=1, indent=4)
level == 1 && println(roottype)
for s in subtypes(roottype)
println(join(fill(" ", level * indent)) * string(s))
subtypetree(s, level+1, indent)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment