Re: The Scala REPL output is confusing

Justin du coeur <[email protected]> Mon, 31 Oct 2016 17:11:08 -0400
Newsgroups gmane.comp.lang.scala
Message-ID <CAO26FW2eT-AApoTByKEoaw_-T51ENpkA=-QDYDnCkyKQyO1f8w@mail.gmail.com>
--001a11c15848941f9a05402fa5c8
Content-Type: text/plain; charset=UTF-8

(Note that this conversation started over on Gitter, and moved here.)

That's fair, but note that the output *isn't legal Scala*.  The "method
created" bit I agree is arguable, but it really is kind of weird and
confusing that there's no colon before "Int" in the output -- the output
syntax seems strangely arbitrary.  Was there a specific reason for that, or
is it just an old "seemed good enough at the time"?

I should note that I don't care passionately -- I don't use the REPL much
myself.  But this seems like a pointless roadbump for new users, having the
output be almost, but not quite, legal Scala.

And really, is "unnecessary clutter" (at least in small amounts) actually a
problem in the REPL?  I would say that clarity is likely a higher priority
than output conciseness...

On Mon, Oct 31, 2016 at 4:55 PM, Oliver Ruebenacker <[email protected]>
wrote:

>
>      Hello,
>
>   That would add unnecessary clutter. Whoever entered the line knows they
> used def.
>
>      Best, Oliver
>
> On Mon, Oct 31, 2016 at 4:51 PM, Raphael Bosshard <
> [email protected]> wrote:
>
>> Hi all,
>>
>> have you ever noticed how confusing the Scala REPL output it?
>>
>> scala> def foo(in: String): Int = ???
>> foo: (in: String)Int
>>
>> I have learned what this "foo: (in: String)Int) is supposed to mean. But
>> from a beginner's perspective I find it puzzling. Instead it should display
>> something like this:
>>
>> method created: foo(in: String): Int
>>
>> Would someone support/guide me in fixing this?
>>
>> Cheers,
>> Raphael
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "scala-language" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Oliver Ruebenacker
> Senior Software Engineer, Diabetes Portal
> <http://www.type2diabetesgenetics.org/>, Broad Institute
> <http://www.broadinstitute.org/>
>
> --
> You received this message because you are subscribed to the Google Groups
> "scala-language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

--001a11c15848941f9a05402fa5c8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">(Note that this conversation started over on Gitter, and m=
oved here.)<div><br></div><div>That&#39;s fair, but note that the output <i=
>isn&#39;t legal Scala</i>.=C2=A0 The &quot;method created&quot; bit I agre=
e is arguable, but it really is kind of weird and confusing that there&#39;=
s no colon before &quot;Int&quot; in the output -- the output syntax seems =
strangely arbitrary.=C2=A0 Was there a specific reason for that, or is it j=
ust an old &quot;seemed good enough at the time&quot;?</div><div><br></div>=
<div>I should note that I don&#39;t care passionately -- I don&#39;t use th=
e REPL much myself.=C2=A0 But this seems like a pointless roadbump for new =
users, having the output be almost, but not quite, legal Scala.</div><div><=
br></div><div>And really, is &quot;unnecessary clutter&quot; (at least in s=
mall amounts) actually a problem in the REPL?=C2=A0 I would say that clarit=
y is likely a higher priority than output conciseness...</div></div><div cl=
ass=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Oct 31, 2016 at =
4:55 PM, Oliver Ruebenacker <span dir=3D"ltr">&lt;<a href=3D"mailto:curoli@=
gmail.com" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><div><div><div><br></div>=C2=A0=
=C2=A0=C2=A0=C2=A0 Hello,<br><br></div>=C2=A0 That would add unnecessary cl=
utter. Whoever entered the line knows they used def. <br><br></div>=C2=A0=
=C2=A0=C2=A0=C2=A0 Best, Oliver<br></div><div class=3D"gmail_extra"><div><d=
iv class=3D"h5"><br><div class=3D"gmail_quote">On Mon, Oct 31, 2016 at 4:51=
 PM, Raphael Bosshard <span dir=3D"ltr">&lt;<a href=3D"mailto:raphael.bossh=
[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> =
wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi all,<br><br>ha=
ve you ever noticed how confusing the Scala REPL output it?<br><br><div sty=
le=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);borde=
r-style:solid;border-width:1px" class=3D"m_2532202319531310957m_74908661023=
73541101prettyprint"><code class=3D"m_2532202319531310957m_7490866102373541=
101prettyprint"><div class=3D"m_2532202319531310957m_7490866102373541101sub=
prettyprint"><span style=3D"color:#000" class=3D"m_2532202319531310957m_749=
0866102373541101styled-by-prettify">scala</span><span style=3D"color:#660" =
class=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify">&gt;=
</span><span style=3D"color:#000" class=3D"m_2532202319531310957m_749086610=
2373541101styled-by-prettify"> </span><span style=3D"color:#008" class=3D"m=
_2532202319531310957m_7490866102373541101styled-by-prettify">def</span><spa=
n style=3D"color:#000" class=3D"m_2532202319531310957m_7490866102373541101s=
tyled-by-prettify"> foo</span><span style=3D"color:#660" class=3D"m_2532202=
319531310957m_7490866102373541101styled-by-prettify">(</span><span style=3D=
"color:#008" class=3D"m_2532202319531310957m_7490866102373541101styled-by-p=
rettify">in</span><span style=3D"color:#660" class=3D"m_2532202319531310957=
m_7490866102373541101styled-by-prettify">:</span><span style=3D"color:#000"=
 class=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify"> </=
span><span style=3D"color:#606" class=3D"m_2532202319531310957m_74908661023=
73541101styled-by-prettify">String</span><span style=3D"color:#660" class=
=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify">):</span>=
<span style=3D"color:#000" class=3D"m_2532202319531310957m_7490866102373541=
101styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_253220=
2319531310957m_7490866102373541101styled-by-prettify">Int</span><span style=
=3D"color:#000" class=3D"m_2532202319531310957m_7490866102373541101styled-b=
y-prettify"> </span><span style=3D"color:#660" class=3D"m_25322023195313109=
57m_7490866102373541101styled-by-prettify">=3D</span><span style=3D"color:#=
000" class=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify"=
> </span><span style=3D"color:#660" class=3D"m_2532202319531310957m_7490866=
102373541101styled-by-prettify">???</span><span style=3D"color:#000" class=
=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify"><br>foo</=
span><span style=3D"color:#660" class=3D"m_2532202319531310957m_74908661023=
73541101styled-by-prettify">:</span><span style=3D"color:#000" class=3D"m_2=
532202319531310957m_7490866102373541101styled-by-prettify"> </span><span st=
yle=3D"color:#660" class=3D"m_2532202319531310957m_7490866102373541101style=
d-by-prettify">(</span><span style=3D"color:#008" class=3D"m_25322023195313=
10957m_7490866102373541101styled-by-prettify">in</span><span style=3D"color=
:#660" class=3D"m_2532202319531310957m_7490866102373541101styled-by-prettif=
y">:</span><span style=3D"color:#000" class=3D"m_2532202319531310957m_74908=
66102373541101styled-by-prettify"> </span><span style=3D"color:#606" class=
=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify">String</s=
pan><span style=3D"color:#660" class=3D"m_2532202319531310957m_749086610237=
3541101styled-by-prettify">)</span><span style=3D"color:#606" class=3D"m_25=
32202319531310957m_7490866102373541101styled-by-prettify">Int</span><span s=
tyle=3D"color:#000" class=3D"m_2532202319531310957m_7490866102373541101styl=
ed-by-prettify"><br></span></div></code></div><br>I have learned what this =
&quot;foo: (in: String)Int) is supposed to mean. But from a beginner&#39;s =
perspective I find it puzzling. Instead it should display something like th=
is:<br><span style=3D"color:#000" class=3D"m_2532202319531310957m_749086610=
2373541101styled-by-prettify"></span><br><span style=3D"color:#000" class=
=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify"></span><d=
iv style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187)=
;border-style:solid;border-width:1px" class=3D"m_2532202319531310957m_74908=
66102373541101prettyprint"><code class=3D"m_2532202319531310957m_7490866102=
373541101prettyprint"><div class=3D"m_2532202319531310957m_7490866102373541=
101subprettyprint"><span style=3D"color:#000" class=3D"m_253220231953131095=
7m_7490866102373541101styled-by-prettify">method created</span><span style=
=3D"color:#660" class=3D"m_2532202319531310957m_7490866102373541101styled-b=
y-prettify">:</span><span style=3D"color:#000" class=3D"m_25322023195313109=
57m_7490866102373541101styled-by-prettify"> foo</span><span style=3D"color:=
#660" class=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify=
">(</span><span style=3D"color:#008" class=3D"m_2532202319531310957m_749086=
6102373541101styled-by-prettify">in</span><span style=3D"color:#660" class=
=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify">:</span><=
span style=3D"color:#000" class=3D"m_2532202319531310957m_74908661023735411=
01styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_2532202=
319531310957m_7490866102373541101styled-by-prettify">String</span><span sty=
le=3D"color:#660" class=3D"m_2532202319531310957m_7490866102373541101styled=
-by-prettify">):</span><span style=3D"color:#000" class=3D"m_25322023195313=
10957m_7490866102373541101styled-by-prettify"> </span><span style=3D"color:=
#606" class=3D"m_2532202319531310957m_7490866102373541101styled-by-prettify=
">Int</span><span style=3D"color:#000" class=3D"m_2532202319531310957m_7490=
866102373541101styled-by-prettify"> <br></span></div></code></div><code cla=
ss=3D"m_2532202319531310957m_7490866102373541101prettyprint"></code><br><co=
de class=3D"m_2532202319531310957m_7490866102373541101prettyprint"><div cla=
ss=3D"m_2532202319531310957m_7490866102373541101subprettyprint"><span style=
=3D"color:#000" class=3D"m_2532202319531310957m_7490866102373541101styled-b=
y-prettify"></span></div></code>Would someone support/guide me in fixing th=
is?<br><br>Cheers,<br>Raphael<span class=3D"m_2532202319531310957HOEnZb"><f=
ont color=3D"#888888"><br><br><br><br></font></span></div><span class=3D"m_=
2532202319531310957HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;scala-language&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]" targ=
et=3D"_blank">scala-language+unsubscribe@goo<wbr>glegroups.com</a>.<br>
For more options, visit <a href=3D"https://groups.google.com/d/optout" targ=
et=3D"_blank">https://groups.google.com/d/op<wbr>tout</a>.<br>
</font></span></blockquote></div><br><br clear=3D"all"><br></div></div><spa=
n class=3D"HOEnZb"><font color=3D"#888888">-- <br><div class=3D"m_253220231=
9531310957gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l=
tr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div>=
Oliver Ruebenacker<br></div><div>Senior Software Engineer, <a href=3D"http:=
//www.type2diabetesgenetics.org/" target=3D"_blank">Diabetes Portal</a>, <a=
 href=3D"http://www.broadinstitute.org/" target=3D"_blank">Broad Institute<=
/a><br></div><br></div></div></div></div></div></div></div></div>
</font></span></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;scala-language&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]" targ=
et=3D"_blank">scala-language+unsubscribe@<wbr>googlegroups.com</a>.<br>
For more options, visit <a href=3D"https://groups.google.com/d/optout" targ=
et=3D"_blank">https://groups.google.com/d/<wbr>optout</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;scala-language&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">scal=
[email protected]</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

--001a11c15848941f9a05402fa5c8--