Interesting. I didn't think to use dump to check differences.

Another followup question. After using dump on some simple if statements, 
I've noticed that all blocks induce this LineNumberNode which is messing up 
the equality.
Is there a way to ignore these nodes in the equality check? They show up in 
any kind of block statement (function, if, etc)

eg:

dump(:(if true 1 else 0 end))

Expr 

  head: Symbol if

  args: Array(Any,(3,))

    1: Bool true

    2: Expr 

      head: Symbol block

      args: Array(Any,(2,))

        1: LineNumberNode 

          file: Symbol none

          line: Int64 1

        2: Int64 1

      typ: Any

    3: Expr 

      head: Symbol block

      args: Array(Any,(2,))

        1: LineNumberNode 

          file: Symbol none

          line: Int64 1

        2: Int64 0

      typ: Any

  typ: Any


dump(Expr(:if, true, Expr(:block, 0), Expr(:block,1)))

Expr 

  head: Symbol if

  args: Array(Any,(3,))

    1: Bool true

    2: Expr 

      head: Symbol block

      args: Array(Any,(1,))

        1: Int64 0

      typ: Any

    3: Expr 

      head: Symbol block

      args: Array(Any,(1,))

        1: Int64 1

      typ: Any

  typ: Any


They're the same minus LineNumberNodes, because block type expressions 
always create those things.

On Wednesday, December 9, 2015 at 7:21:55 AM UTC-8, STAR0SS wrote:
>
> You can also use dump() on your expressions to see how they differ 
> exactly. The normal printing doesn't really show you much.
>

Reply via email to