This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Absolute beginner question

5 replies
lezzgiles
Joined: 2009-11-05,
User offline. Last seen 42 years 45 weeks ago.

On FC11, just downloaded & installed scala using yum install scala, got
version 2.7.4.

I've run it interactively and it works fine.

I create a one-line hello world script...

println("Hello, world from a script!")

...and run it...

[lezzgiles@bedroom scala]$ scala hello.scala
bedroom: bedroom
[lezzgiles@bedroom scala]$

Note that "bedroom" is my hostname. I've googled for some kind of answer,
but can't find anything. If I try it with a non-existent file, it does the
sensible thing:

[lezzgiles@bedroom scala]$ scala /no-such-file
no such file: /no-such-file
[lezzgiles@bedroom scala]$

If I try it with a file that doesn't contain valid scala, it also just
prints out the hostname a couple of times:

[lezzgiles@bedroom scala]$ scala ~/.bash_profile
bedroom: bedroom
[lezzgiles@bedroom scala]$

I really want to start playing with this language, but I'm sort-of stuck
here...

Lezz Giles

Dean Wampler
Joined: 2008-12-26,
User offline. Last seen 42 years 45 weeks ago.
Re: Absolute beginner question
OOPS! didn't reply to all:
2.7.4 is fairly old, but I just tried that version and it worked fine. Try "set -x" on the command line, then run it. I'm not sure it will tell us anything, but...
dean
On Thu, Nov 5, 2009 at 4:04 PM, lezzgiles <lezzgiles [at] gmail [dot] com> wrote:

On FC11, just downloaded & installed scala using yum install scala, got
version 2.7.4.

I've run it interactively and it works fine.

I create a one-line hello world script...

println("Hello, world from a script!")

...and run it...

[lezzgiles@bedroom scala]$ scala hello.scala
bedroom: bedroom
[lezzgiles@bedroom scala]$

Note that "bedroom" is my hostname.  I've googled for some kind of answer,
but can't find anything.  If I try it with a non-existent file, it does the
sensible thing:

[lezzgiles@bedroom scala]$ scala /no-such-file
no such file: /no-such-file
[lezzgiles@bedroom scala]$

If I try it with a file that doesn't contain valid scala, it also just
prints out the hostname a couple of times:

[lezzgiles@bedroom scala]$ scala ~/.bash_profile
bedroom: bedroom
[lezzgiles@bedroom scala]$

I really want to start playing with this language, but I'm sort-of stuck
here...

Lezz Giles
--
View this message in context: http://old.nabble.com/Absolute-beginner-question-tp26222796p26222796.html
Sent from the Scala - User mailing list archive at Nabble.com.




--
Dean Wampler
coauthor of "Programming Scala" (O'Reilly)
-  http://programmingscala.com

twitter: @deanwampler, @chicagoscala
Chicago-Area Scala Enthusiasts (CASE):
-  http://groups.google.com/group/chicagoscala
-  http://www.meetup.com/chicagoscala/ (Meetings)
http://www.linkedin.com/in/deanwampler
http://www.polyglotprogramming.com
http://aquarium.rubyforge.org
http://www.contract4j.org
Kevin Wright
Joined: 2009-06-09,
User offline. Last seen 49 weeks 3 days ago.
Re: Absolute beginner question

We've seen something like this on the lists before.
In that case it was a problem with networking config on the machine

Take a look at this thread:
http://old.nabble.com/println-don't-work-to25194605.html#a25195269

On Thu, Nov 5, 2009 at 10:04 PM, lezzgiles wrote:
>
> On FC11, just downloaded & installed scala using yum install scala, got
> version 2.7.4.
>
> I've run it interactively and it works fine.
>
> I create a one-line hello world script...
>
> println("Hello, world from a script!")
>
> ...and run it...
>
> [lezzgiles@bedroom scala]$ scala hello.scala
> bedroom: bedroom
> [lezzgiles@bedroom scala]$
>
> Note that "bedroom" is my hostname.  I've googled for some kind of answer,
> but can't find anything.  If I try it with a non-existent file, it does the
> sensible thing:
>
> [lezzgiles@bedroom scala]$ scala /no-such-file
> no such file: /no-such-file
> [lezzgiles@bedroom scala]$
>
> If I try it with a file that doesn't contain valid scala, it also just
> prints out the hostname a couple of times:
>
> [lezzgiles@bedroom scala]$ scala ~/.bash_profile
> bedroom: bedroom
> [lezzgiles@bedroom scala]$
>
> I really want to start playing with this language, but I'm sort-of stuck
> here...
>
> Lezz Giles
> --
> View this message in context: http://old.nabble.com/Absolute-beginner-question-tp26222796p26222796.html
> Sent from the Scala - User mailing list archive at Nabble.com.
>
>

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Absolute beginner question
Funny you couldn't find anything.   Basically, Scala requirest `hostname` to be reachable on the network. If you can't ping it, you can't use neither "scala" nor "fsc". You can use "scalac" to compile, though.   The reason for that is that "fsc" install itself as a daemon, to speed up compilation. The "scala" command, used for scripts and REPL, uses "fsc" to improve its own performance.   My suggestion, edit /etc/hosts and add your hostname to the line with 127.0.0.1.
On Thu, Nov 5, 2009 at 8:04 PM, lezzgiles <lezzgiles [at] gmail [dot] com> wrote:

On FC11, just downloaded & installed scala using yum install scala, got
version 2.7.4.

I've run it interactively and it works fine.

I create a one-line hello world script...

println("Hello, world from a script!")

...and run it...

[lezzgiles@bedroom scala]$ scala hello.scala
bedroom: bedroom
[lezzgiles@bedroom scala]$

Note that "bedroom" is my hostname.  I've googled for some kind of answer,
but can't find anything.  If I try it with a non-existent file, it does the
sensible thing:

[lezzgiles@bedroom scala]$ scala /no-such-file
no such file: /no-such-file
[lezzgiles@bedroom scala]$

If I try it with a file that doesn't contain valid scala, it also just
prints out the hostname a couple of times:

[lezzgiles@bedroom scala]$ scala ~/.bash_profile
bedroom: bedroom
[lezzgiles@bedroom scala]$

I really want to start playing with this language, but I'm sort-of stuck
here...

Lezz Giles
--
View this message in context: http://old.nabble.com/Absolute-beginner-question-tp26222796p26222796.html
Sent from the Scala - User mailing list archive at Nabble.com.




--
Daniel C. Sobral

Veni, vidi, veterni.
lezzgiles
Joined: 2009-11-05,
User offline. Last seen 42 years 45 weeks ago.
Re: Absolute beginner question

Problem solved - I hadn't set up /etc/hosts with the filename. I've seen
similar problems with redhat-based distros with other tools.

Thanks for the help - I'm looking forward to replacing my Perl/Python/Ruby
expertise with Scala...

Lezz

Daniel Sobral wrote:
>
> Funny you couldn't find anything.
>
> Basically, Scala requirest `hostname` to be reachable on the network. If
> you
> can't ping it, you can't use neither "scala" nor "fsc". You can use
> "scalac"
> to compile, though.
>
> The reason for that is that "fsc" install itself as a daemon, to speed up
> compilation. The "scala" command, used for scripts and REPL, uses "fsc" to
> improve its own performance.
>
> My suggestion, edit /etc/hosts and add your hostname to the line with
> 127.0.0.1.
> On Thu, Nov 5, 2009 at 8:04 PM, lezzgiles wrote:
>
>>
>> On FC11, just downloaded & installed scala using yum install scala, got
>> version 2.7.4.
>>
>> I've run it interactively and it works fine.
>>
>> I create a one-line hello world script...
>>
>> println("Hello, world from a script!")
>>
>> ...and run it...
>>
>> [lezzgiles@bedroom scala]$ scala hello.scala
>> bedroom: bedroom
>> [lezzgiles@bedroom scala]$
>>
>> Note that "bedroom" is my hostname. I've googled for some kind of
>> answer,
>> but can't find anything. If I try it with a non-existent file, it does
>> the
>> sensible thing:
>>
>> [lezzgiles@bedroom scala]$ scala /no-such-file
>> no such file: /no-such-file
>> [lezzgiles@bedroom scala]$
>>
>> If I try it with a file that doesn't contain valid scala, it also just
>> prints out the hostname a couple of times:
>>
>> [lezzgiles@bedroom scala]$ scala ~/.bash_profile
>> bedroom: bedroom
>> [lezzgiles@bedroom scala]$
>>
>> I really want to start playing with this language, but I'm sort-of stuck
>> here...
>>
>> Lezz Giles
>> --
>> View this message in context:
>> http://old.nabble.com/Absolute-beginner-question-tp26222796p26222796.html
>> Sent from the Scala - User mailing list archive at Nabble.com.
>>
>>
>
>

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Absolute beginner question
FWIW, I have a lot of experience with Perl. If you need help to relate some concept from Perl to Scala, feel free to e-mail me directly.

On Fri, Nov 6, 2009 at 1:56 AM, lezzgiles <lezzgiles [at] gmail [dot] com> wrote:

Problem solved - I hadn't set up /etc/hosts with the filename.  I've seen
similar problems with redhat-based distros with other tools.

Thanks for the help - I'm looking forward to replacing my Perl/Python/Ruby
expertise with Scala...

Lezz


Daniel Sobral wrote:
>
> Funny you couldn't find anything.
>
> Basically, Scala requirest `hostname` to be reachable on the network. If
> you
> can't ping it, you can't use neither "scala" nor "fsc". You can use
> "scalac"
> to compile, though.
>
> The reason for that is that "fsc" install itself as a daemon, to speed up
> compilation. The "scala" command, used for scripts and REPL, uses "fsc" to
> improve its own performance.
>
> My suggestion, edit /etc/hosts and add your hostname to the line with
> 127.0.0.1.
> On Thu, Nov 5, 2009 at 8:04 PM, lezzgiles <lezzgiles [at] gmail [dot] com> wrote:
>
>>
>> On FC11, just downloaded & installed scala using yum install scala, got
>> version 2.7.4.
>>
>> I've run it interactively and it works fine.
>>
>> I create a one-line hello world script...
>>
>> println("Hello, world from a script!")
>>
>> ...and run it...
>>
>> [lezzgiles@bedroom scala]$ scala hello.scala
>> bedroom: bedroom
>> [lezzgiles@bedroom scala]$
>>
>> Note that "bedroom" is my hostname.  I've googled for some kind of
>> answer,
>> but can't find anything.  If I try it with a non-existent file, it does
>> the
>> sensible thing:
>>
>> [lezzgiles@bedroom scala]$ scala /no-such-file
>> no such file: /no-such-file
>> [lezzgiles@bedroom scala]$
>>
>> If I try it with a file that doesn't contain valid scala, it also just
>> prints out the hostname a couple of times:
>>
>> [lezzgiles@bedroom scala]$ scala ~/.bash_profile
>> bedroom: bedroom
>> [lezzgiles@bedroom scala]$
>>
>> I really want to start playing with this language, but I'm sort-of stuck
>> here...
>>
>> Lezz Giles
>> --
>> View this message in context:
>> http://old.nabble.com/Absolute-beginner-question-tp26222796p26222796.html
>> Sent from the Scala - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Daniel C. Sobral
>
> Veni, vidi, veterni.
>
>

--
View this message in context: http://old.nabble.com/Absolute-beginner-question-tp26222796p26226541.html
Sent from the Scala - User mailing list archive at Nabble.com.




--
Daniel C. Sobral

Veni, vidi, veterni.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland