Re: The Scala REPL output is confusing
Oliver Ruebenacker <[email protected]> Mon, 31 Oct 2016 17:55:38 -0400
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CAA=X4OC55XhTqxW29OORpK=hpwQrYfX12ZR1fVJ4QwYeUn18iQ@mail.gmail.com> |
--001a114f86dcb896d705403044c7
Content-Type: text/plain; charset=UTF-8
Hello,
The line is just:
<name>: <type>
With "(in: String)Int" being the type of the method.
This resembles JNI method type notation, where the return type goes
directly after the parens, too.
Best, Oliver
On Mon, Oct 31, 2016 at 5:11 PM, Justin du coeur <[email protected]> wrote:
> (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.
>
--
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.
--001a114f86dcb896d705403044c7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div><div><div><div><div><br></div>=C2=A0=C2=A0=C2=A0=
=C2=A0 Hello,<br><br></div>=C2=A0 The line is just:<br><br></div><name&g=
t;: <type><br><br></div>=C2=A0 With "(in: String)Int" being=
the type of the method. <br><br></div>=C2=A0 This resembles JNI method typ=
e notation, where the return type goes directly after the parens, too.<br><=
br></div>=C2=A0=C2=A0=C2=A0=C2=A0 Best, Oliver<br></div><div class=3D"gmail=
_extra"><br><div class=3D"gmail_quote">On Mon, Oct 31, 2016 at 5:11 PM, Jus=
tin du coeur <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" ta=
rget=3D"_blank">[email protected]</a>></span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr">(Note that this conversation started over =
on Gitter, and moved here.)<div><br></div><div>That's fair, but note th=
at the output <i>isn't legal Scala</i>.=C2=A0 The "method created&=
quot; 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 outp=
ut syntax seems strangely arbitrary.=C2=A0 Was there a specific reason for =
that, or is it just an old "seemed good enough at the time"?</div=
><div><br></div><div>I should note that I don't care passionately -- I =
don't use the REPL much myself.=C2=A0 But this seems like a pointless r=
oadbump for new users, having the output be almost, but not quite, legal Sc=
ala.</div><div><br></div><div>And really, is "unnecessary clutter"=
; (at least in small amounts) actually a problem in the REPL?=C2=A0 I would=
say that clarity is likely a higher priority than output conciseness...</d=
iv></div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra"=
><br><div class=3D"gmail_quote">On Mon, Oct 31, 2016 at 4:55 PM, Oliver Rue=
benacker <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>></span> wrote:<br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc 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 clutter. 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><div class=3D"m_3=
837995461070946043h5"><br><div class=3D"gmail_quote">On Mon, Oct 31, 2016 a=
t 4:51 PM, Raphael Bosshard <span dir=3D"ltr"><<a href=3D"mailto:raphael=
[email protected]" target=3D"_blank">[email protected]</a>></=
span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi all,<br>=
<br>have you ever noticed how confusing the Scala REPL output it?<br><br><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_3837995461070946043m_25322=
02319531310957m_7490866102373541101prettyprint"><code class=3D"m_3837995461=
070946043m_2532202319531310957m_7490866102373541101prettyprint"><div class=
=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541101subprett=
yprint"><span style=3D"color:#000" class=3D"m_3837995461070946043m_25322023=
19531310957m_7490866102373541101styled-by-prettify">scala</span><span style=
=3D"color:#660" class=3D"m_3837995461070946043m_2532202319531310957m_749086=
6102373541101styled-by-prettify">></span><span style=3D"color:#000" clas=
s=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541101styled-=
by-prettify"> </span><span style=3D"color:#008" class=3D"m_3837995461070946=
043m_2532202319531310957m_7490866102373541101styled-by-prettify">def</span>=
<span style=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531310=
957m_7490866102373541101styled-by-prettify"> foo</span><span style=3D"color=
:#660" class=3D"m_3837995461070946043m_2532202319531310957m_749086610237354=
1101styled-by-prettify">(</span><span style=3D"color:#008" class=3D"m_38379=
95461070946043m_2532202319531310957m_7490866102373541101styled-by-prettify"=
>in</span><span style=3D"color:#660" class=3D"m_3837995461070946043m_253220=
2319531310957m_7490866102373541101styled-by-prettify">:</span><span style=
=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531310957m_749086=
6102373541101styled-by-prettify"> </span><span style=3D"color:#606" class=
=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541101styled-b=
y-prettify">String</span><span style=3D"color:#660" class=3D"m_383799546107=
0946043m_2532202319531310957m_7490866102373541101styled-by-prettify">):</sp=
an><span style=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531=
310957m_7490866102373541101styled-by-prettify"> </span><span style=3D"color=
:#606" class=3D"m_3837995461070946043m_2532202319531310957m_749086610237354=
1101styled-by-prettify">Int</span><span style=3D"color:#000" class=3D"m_383=
7995461070946043m_2532202319531310957m_7490866102373541101styled-by-prettif=
y"> </span><span style=3D"color:#660" class=3D"m_3837995461070946043m_25322=
02319531310957m_7490866102373541101styled-by-prettify">=3D</span><span styl=
e=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531310957m_74908=
66102373541101styled-by-prettify"> </span><span style=3D"color:#660" class=
=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541101styled-b=
y-prettify">???</span><span style=3D"color:#000" class=3D"m_383799546107094=
6043m_2532202319531310957m_7490866102373541101styled-by-prettify"><br>foo</=
span><span style=3D"color:#660" class=3D"m_3837995461070946043m_25322023195=
31310957m_7490866102373541101styled-by-prettify">:</span><span style=3D"col=
or:#000" class=3D"m_3837995461070946043m_2532202319531310957m_7490866102373=
541101styled-by-prettify"> </span><span style=3D"color:#660" class=3D"m_383=
7995461070946043m_2532202319531310957m_7490866102373541101styled-by-prettif=
y">(</span><span style=3D"color:#008" class=3D"m_3837995461070946043m_25322=
02319531310957m_7490866102373541101styled-by-prettify">in</span><span style=
=3D"color:#660" class=3D"m_3837995461070946043m_2532202319531310957m_749086=
6102373541101styled-by-prettify">:</span><span style=3D"color:#000" class=
=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541101styled-b=
y-prettify"> </span><span style=3D"color:#606" class=3D"m_38379954610709460=
43m_2532202319531310957m_7490866102373541101styled-by-prettify">String</spa=
n><span style=3D"color:#660" class=3D"m_3837995461070946043m_25322023195313=
10957m_7490866102373541101styled-by-prettify">)</span><span style=3D"color:=
#606" class=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541=
101styled-by-prettify">Int</span><span style=3D"color:#000" class=3D"m_3837=
995461070946043m_2532202319531310957m_7490866102373541101styled-by-prettify=
"><br></span></div></code></div><br>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:<br><span s=
tyle=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531310957m_74=
90866102373541101styled-by-prettify"></span><br><span style=3D"color:#000" =
class=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541101sty=
led-by-prettify"></span><div style=3D"background-color:rgb(250,250,250);bor=
der-color:rgb(187,187,187);border-style:solid;border-width:1px" class=3D"m_=
3837995461070946043m_2532202319531310957m_7490866102373541101prettyprint"><=
code class=3D"m_3837995461070946043m_2532202319531310957m_74908661023735411=
01prettyprint"><div class=3D"m_3837995461070946043m_2532202319531310957m_74=
90866102373541101subprettyprint"><span style=3D"color:#000" class=3D"m_3837=
995461070946043m_2532202319531310957m_7490866102373541101styled-by-prettify=
">method created</span><span style=3D"color:#660" class=3D"m_38379954610709=
46043m_2532202319531310957m_7490866102373541101styled-by-prettify">:</span>=
<span style=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531310=
957m_7490866102373541101styled-by-prettify"> foo</span><span style=3D"color=
:#660" class=3D"m_3837995461070946043m_2532202319531310957m_749086610237354=
1101styled-by-prettify">(</span><span style=3D"color:#008" class=3D"m_38379=
95461070946043m_2532202319531310957m_7490866102373541101styled-by-prettify"=
>in</span><span style=3D"color:#660" class=3D"m_3837995461070946043m_253220=
2319531310957m_7490866102373541101styled-by-prettify">:</span><span style=
=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531310957m_749086=
6102373541101styled-by-prettify"> </span><span style=3D"color:#606" class=
=3D"m_3837995461070946043m_2532202319531310957m_7490866102373541101styled-b=
y-prettify">String</span><span style=3D"color:#660" class=3D"m_383799546107=
0946043m_2532202319531310957m_7490866102373541101styled-by-prettify">):</sp=
an><span style=3D"color:#000" class=3D"m_3837995461070946043m_2532202319531=
310957m_7490866102373541101styled-by-prettify"> </span><span style=3D"color=
:#606" class=3D"m_3837995461070946043m_2532202319531310957m_749086610237354=
1101styled-by-prettify">Int</span><span style=3D"color:#000" class=3D"m_383=
7995461070946043m_2532202319531310957m_7490866102373541101styled-by-prettif=
y"> <br></span></div></code></div><code class=3D"m_3837995461070946043m_253=
2202319531310957m_7490866102373541101prettyprint"></code><br><code class=3D=
"m_3837995461070946043m_2532202319531310957m_7490866102373541101prettyprint=
"><div class=3D"m_3837995461070946043m_2532202319531310957m_749086610237354=
1101subprettyprint"><span style=3D"color:#000" class=3D"m_38379954610709460=
43m_2532202319531310957m_7490866102373541101styled-by-prettify"></span></di=
v></code>Would someone support/guide me in fixing this?<br><br>Cheers,<br>R=
aphael<span class=3D"m_3837995461070946043m_2532202319531310957HOEnZb"><fon=
t color=3D"#888888"><br><br><br><br></font></span></div><span class=3D"m_38=
37995461070946043m_2532202319531310957HOEnZb"><font color=3D"#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;scala-language" 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"m_3837995461070946043HOEnZb"><font color=3D"#888888">-- <br><div=
class=3D"m_3837995461070946043m_2532202319531310957gmail_signature" data-s=
martmail=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><d=
iv 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.broadinstitut=
e.org/" target=3D"_blank">Broad Institute</a><br></div><br></div></div></di=
v></div></div></div></div></div>
</font></span></div><div class=3D"m_3837995461070946043HOEnZb"><div class=
=3D"m_3837995461070946043h5">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;scala-language" 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>
</div></div></blockquote></div><br></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;scala-language" 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><br clear=3D"all"><br>-- <br><div class=
=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><d=
iv><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><b=
r></div><br></div></div></div></div></div></div></div></div>
</div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;scala-language" 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 />
--001a114f86dcb896d705403044c7--