RE: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-08 Thread David Anthoff
Ah, thanks for the answer, that does make sense. > -Original Message- > From: julia-users@googlegroups.com [mailto:julia- > us...@googlegroups.com] On Behalf Of Yichao Yu > Sent: Monday, November 7, 2016 8:02 PM > To: Julia Users > Subject: Re: [julia-users] Re: Escape

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:55 PM, cdm wrote: > > > On Monday, November 7, 2016 at 7:51:34 PM UTC-8, Yichao Yu wrote: >> >> Just to be clear. print/println does not "un-decorate" anything at >> all. It's `show`/`display`/`dump` "decorate" (escape/quote) it. > > > perhaps the help docs are not clear

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread cdm
On Monday, November 7, 2016 at 7:51:34 PM UTC-8, Yichao Yu wrote: > > Just to be clear. print/println does not "un-decorate" anything at > all. It's `show`/`display`/`dump` "decorate" (escape/quote) it. > perhaps the help docs are not clear then ... ? print(x) Write (to the default outp

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:48 PM, cdm wrote: > > On Monday, November 7, 2016 at 7:31:52 PM UTC-8, Yichao Yu wrote: >> >> >> Both? I don't see the difference. I'm only saying that `show` does not >> simply write the string to the stream, but prints the representation >> of the string object instead,

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread cdm
On Monday, November 7, 2016 at 7:31:52 PM UTC-8, Yichao Yu wrote: > > > Both? I don't see the difference. I'm only saying that `show` does not > simply write the string to the stream, but prints the representation > of the string object instead, which is the quoted string. > julia> dump(a)

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:31 PM, cdm wrote: > to your point (in the same session): > > julia> show(b) > nothing Yes? the return value of print/println/show has nothing to do with the object being printed. > > > > On Monday, November 7, 2016 at 7:28:38 PM UTC-8, cdm wrote: >> >> On Monday, Novemb

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread cdm
to your point (in the same session): julia> show(b) nothing On Monday, November 7, 2016 at 7:28:38 PM UTC-8, cdm wrote: > > On Monday, November 7,

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:28 PM, cdm wrote: > On Monday, November 7, 2016 at 7:23:10 PM UTC-8, Yichao Yu wrote: >> >> fwiw, show does more stuff on the string than either print or println. >> None of them return anything even though print and println does not do >> any stuff on the string. > > > s

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread cdm
On Monday, November 7, 2016 at 7:23:10 PM UTC-8, Yichao Yu wrote: > fwiw, show does more stuff on the string than either print or println. > None of them return anything even though print and println does not do > any stuff on the string. > so in the course of what was defined above, was "a" de

[julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread cdm
in the terminal: julia> a = "i have \$100 ..." "i have \$100 ..." julia> aa = eval(a)

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:16 PM, cdm wrote: > > > On Monday, November 7, 2016 at 7:13:03 PM UTC-8, Yichao Yu wrote: >> >> > so, more "stuff" is happening >> > within the println() function ... >> >> No. println/print output the string, show/display prints it as an >> object and do so in a way that

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread cdm
On Monday, November 7, 2016 at 7:13:03 PM UTC-8, Yichao Yu wrote: > > > so, more "stuff" is happening > > within the println() function ... > > No. println/print output the string, show/display prints it as an > object and do so in a way that shows more detail about the string > itself. > No

Re: [julia-users] Re: Escaped $ in Strings has a strange behavior

2016-11-07 Thread Yichao Yu
On Mon, Nov 7, 2016 at 10:06 PM, cdm wrote: > > in the terminal: > > julia> a = "i have \$100 ..." > "i have \$100 ..." > > julia> aa = eval(a) > "i have \$100 ..." ^^ FWIW, this is a no-op > > julia> a == aa > true ^^ Which should make this not very surprising. > > julia> b = println(a) > i h