Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidy up dump and xdump #4163

Closed
JeffBezanson opened this issue Aug 27, 2013 · 6 comments
Closed

tidy up dump and xdump #4163

JeffBezanson opened this issue Aug 27, 2013 · 6 comments
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Milestone

Comments

@JeffBezanson
Copy link
Member

These functions have become a basket of odd behaviors, and their implementation is quite complex.

There are differences like this:

julia> dump(Int)
Int64

julia> xdump(Int)
Int64::DataType  <: Signed

Then there is this:

julia> dump(1+2im)
Complex{Int64} 
  re: Int64 1
  im: Int64 2

julia> dump((1+2im,{}))
(Complex{Int64},Array{Any,1}) (1 + 2im,{})

The first output was fine, but put it inside a tuple and something else happens.

Also xdump is not documented. If the current behavior does actually make sense, then the task here is to explain it by documenting dump and xdump better.

But I propose that we should only have dump, and it should simply traverse a structure and show everything about it.

@jakebolewski jakebolewski added the io Involving the I/O subsystem: libuv, read, write, etc. label Jun 2, 2015
@StefanKarpinski StefanKarpinski added the good first issue Indicates a good issue for first-time contributors to Julia label Jul 9, 2015
@StefanKarpinski
Copy link
Member

Solution could be as simple as deleting xdump and deprecating it in favor of dump. If anyone complains we can fix up various broken corner cases in dump.

@ScottPJones
Copy link
Contributor

But would the dump behave as xdump currently does (which seems to supply more information)?
I might take care of this, if nobody else does, since I was just in this code yesterday (#12072) fixing a bug.

@StefanKarpinski
Copy link
Member

There should only be one and it should give you all of the information in a somewhat readable form. Currently sometimes dump gives you the information you need while sometimes xdump does. The only way to know seems to be trying it out. It would be great if you fixe that. I suspect no one really depends on this output format, so feel free to change and improve it as you see fit.

@ScottPJones
Copy link
Contributor

Ok, thanks! I've been using dump and xdump a lot lately, so I'll try to come up with something to everybody's satisfaction.

@JeffBezanson JeffBezanson removed the io Involving the I/O subsystem: libuv, read, write, etc. label Jul 10, 2015
@JeffBezanson JeffBezanson added this to the 0.5.0 milestone Sep 10, 2015
@mauro3
Copy link
Contributor

mauro3 commented Jan 28, 2016

Buggy with function arguments (similar on jb/functions):

julia> xdump(x->x)
ERROR: ArgumentError: invalid arguments to xdump
 in xdump at show.jl:936

julia> dump(x->x)
(anonymous function)

julia> f(x)=1
f (generic function with 1 method)

julia> xdump(f)
ERROR: ArgumentError: invalid arguments to xdump
 in xdump at show.jl:936

julia> dump(f)
f

@pkofod
Copy link
Contributor

pkofod commented Feb 19, 2016

on master Version 0.5.0-dev+2750 (2016-02-19 04:59 UTC)

julia> dump(x->x)
#1
julia> dump(x->x)
#3
julia> dump(x->x)
#5

Is this supposed to say anonymous function as above?

JeffBezanson added a commit that referenced this issue Mar 31, 2016
JeffBezanson added a commit that referenced this issue Mar 31, 2016
JeffBezanson added a commit that referenced this issue Mar 31, 2016
JeffBezanson added a commit that referenced this issue Apr 25, 2016
JeffBezanson added a commit that referenced this issue Apr 26, 2016
fix #4163, remove `xdump` and simplify `dump`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

6 participants