Skip to content

Instantly share code, notes, and snippets.

@slwu89
Created January 17, 2023 02:25
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 slwu89/0a161695981c2cff2ad432c82c0419ed to your computer and use it in GitHub Desktop.
Save slwu89/0a161695981c2cff2ad432c82c0419ed to your computer and use it in GitHub Desktop.
julia tricks and useful things
# 1. ----------
# "guess what an appropriate container eltype would be for storing results of `f`..."
Base.promote_op
f() = true
Base.promote_op(f)
# 2. ----------
# take apart whatever comes in
dump(f)
expr = :(+(1,2,3,4))
dump(expr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment