To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

This notebook takes about 20 seconds to run.

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1
Error message

syntax: incomplete: premature end of input

👀 Reading hidden code
r(
---
:(f(x, y::Any, z::e(Union{a, b}) = 1, b = b; b::E = 3))
👀 Reading hidden code
f = (quote
function f(x, y::Any, z::e(Union{a,b})=1, b=b; b::E=3)
123
123
123
123
123
end
end).args[2].args[1]
297 μs
:(g(a, z::f...) where T <: 123)
👀 Reading hidden code
g = (quote
function g(a,z::f...) where T <: 123
123
123
123
123
123
end
end).args[2].args[1]
268 μs
👀 Reading hidden code
using PlutoUI
184 ms
Expr
  head: Symbol call
  args: Array{Any}((6,))
    1: Symbol f
    2: Expr
      head: Symbol parameters
      args: Array{Any}((1,))
        1: Expr
          head: Symbol kw
          args: Array{Any}((2,))
            1: Expr
              head: Symbol ::
              args: Array{Any}((2,))
                1: Symbol b
                2: Symbol E
            2: Int64 3
    3: Symbol x
    4: Expr
      head: Symbol ::
      args: Array{Any}((2,))
        1: Symbol y
        2: Symbol Any
    5: Expr
      head: Symbol kw
      args: Array{Any}((2,))
        1: Expr
          head: Symbol ::
          args: Array{Any}((2,))
            1: Symbol z
            2: Expr
              head: Symbol call
              args: Array{Any}((2,))
                1: Symbol e
                2: Expr
                  head: Symbol curly
                  args: Array{Any}((3,))
                    1: Symbol Union
                    2: Symbol a
                    3: Symbol b
        2: Int64 1
    6: Expr
      head: Symbol kw
      args: Array{Any}((2,))
        1: Symbol b
        2: Symbol b
Dump(f, maxdepth=123)
👀 Reading hidden code
5.4 ms
Array{Expr}((4,))
  1: Expr
    head: Symbol ::
    args: Array{Any}((2,))
      1: Nothing nothing
      2: Any
  2: Expr
    head: Symbol ::
    args: Array{Any}((2,))
      1: Nothing nothing
      2: Symbol Any
  3: Expr
    head: Symbol kw
    args: Array{Any}((2,))
      1: Expr
        head: Symbol ::
        args: Array{Any}((2,))
          1: Nothing nothing
          2: Expr
            head: Symbol call
            args: Array{Any}((2,))
              1: Symbol e
              2: Expr
                head: Symbol curly
                args: Array{Any}((3,))
                  1: Symbol Union
                  2: Symbol a
                  3: Symbol b
      2: Nothing nothing
  4: Expr
    head: Symbol kw
    args: Array{Any}((2,))
      1: Expr
        head: Symbol ::
        args: Array{Any}((2,))
          1: Nothing nothing
          2: Any
      2: Nothing nothing
Dump(canonalize(f), maxdepth=234)
👀 Reading hidden code
32.2 ms
canonalize (generic function with 1 method)
function canonalize(ex::Expr)
if ex.head == :where
Expr(:where, canonalize(ex.args[1]), ex.args[2:end]...)
elseif ex.head == :call
ex.args[1] # is the function name, we dont want it

interesting = filter(ex.args[2:end]) do arg
!(arg isa Expr && arg.head == :parameters)
end
hide_argument_name.(interesting)
else
@error "Huh" ex
nothing
end
end
👀 Reading hidden code
3.8 ms
hide_argument_name (generic function with 3 methods)
begin
function hide_argument_name(ex::Expr)
if ex.head == :(::) && length(ex.args) > 1
Expr(:(::), nothing, ex.args[2:end]...)
elseif ex.head == :(...)
Expr(:(...), hide_argument_name(ex.args[1]))
elseif ex.head == :kw
Expr(:kw, hide_argument_name(ex.args[1]), nothing)
else
ex
end
end
hide_argument_name(::Symbol) = Expr(:(::), nothing, Any)
hide_argument_name(x::Any) = x
end
👀 Reading hidden code
1.6 ms