You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I execute (bash command line) a simple hello_world.scala program (see below)
which uses the 2..0 "object extends App" idiom using two steps scalac hello_world.scala,
then scala hello_world, the program prints out the greeting as expected.
When I do a simple "scala hello_world.scala", the program appears to compile, then
return to the command line without having printed anything. The documentation I read
(2.9.0, various RC variants) seemed to indicate that the two ways of executing should
be the same. When I use the older idiom of an explicit main(), I get the same printout
both ways.
I appears that the delayedInit is never being called in the "scala object extends App" case.
Pardon me if this "feature" is documented and I missed it, or if I have a total misunderstanding
of intended behavior. BTW, I've written in a number of languages and Scala is great; explicit but
lightweight. Thank you all for creating & growing it.
object HwApp extends App {
printf("\nHello world App\n")
}
I can work around this in a Makefile, but it seems like either it should work or
I should learn more scala to understand why it does not.
The text was updated successfully, but these errors were encountered:
When I execute (bash command line) a simple hello_world.scala program (see below)
which uses the 2..0 "object extends App" idiom using two steps scalac hello_world.scala,
then scala hello_world, the program prints out the greeting as expected.
When I do a simple "scala hello_world.scala", the program appears to compile, then
return to the command line without having printed anything. The documentation I read
(2.9.0, various RC variants) seemed to indicate that the two ways of executing should
be the same. When I use the older idiom of an explicit main(), I get the same printout
both ways.
I appears that the delayedInit is never being called in the "scala object extends App" case.
Pardon me if this "feature" is documented and I missed it, or if I have a total misunderstanding
of intended behavior. BTW, I've written in a number of languages and Scala is great; explicit but
lightweight. Thank you all for creating & growing it.
object HwApp extends App {
printf("\nHello world App\n")
}
I can work around this in a Makefile, but it seems like either it should work or
I should learn more scala to understand why it does not.
The text was updated successfully, but these errors were encountered: