But it is consistent. If you type 2+2 in the REPL you get 4, and if you put the same code in a loop it won't display 4 anymore. This is highlighted in the documentation. Julia just treats plots like any other type.
I think it's just a documentation issue. Somehow it should be noted in the spots where the documentation describes the behavior of printing/non-printing to the REPL and the use of semicolon. However, that would also be kind of odd because plotting is not part of Julia's base... so other than in the "Noteworthy Differences from Other Languages" I don't know where else it should go. On Monday, May 23, 2016 at 9:42:39 AM UTC-7, David Parks wrote: > > My argument here is really for consistency. > > The beauty of a REPL, for a new user, is being able to hack through a few > lines of code, see how they work in practice, and then use them > confidently. It really speeds learning a new package, understanding a > language feature, or just coding something new. > > I'd be perfectly happy if, in the REPL, when I call `myplot = plot(x,y)`, > I get back a plot object that I then need to display with > `display(myplot)`, or by adding `plot(x,y,show=true)`, or by explicitly > defaulting show=true with `pyplot(show=true)`. If that happened in the > REPL, I'd quickly learn Tom's paradigm, `plot` "constructs a visualization > of the input data" - and I would be benefiting from the REPL as part of my > toolkit, and I'd be happy. But when there's a difference between how the > REPL works and how the same command works in a code block, then I lose the > benefit of the REPL, worse, the REPL teaches me one way of doing things > that I then have to unlearn in an non-intuitive way. > > Whether it's done by default one way or another isn't important if > consistency is maintained. I think the disconnect in this discussion is > rooted in the inconsistency of behavior between REPL and code block. And I > believe that will be a pain point for an untold number of future users. > > In any case, lovely discussion here. :) > >
