0

I have just started Scala programming. This is basic example which is most popular I believe.

I am using Eclipse Scala IDE. I don't understand what type of file I should create for Scala Script from Menu. Is Scala script a Scala File or Scala Class or Scala worksheet or Scala application? Could you please confirm.

// code-examples/IntroducingScala/shapes-actor-script.scala
import shapes._
ShapeDrawingActor.start()
ShapeDrawingActor ! new Circle(new Point(0.0,0.0), 1.0)
ShapeDrawingActor ! new Rectangle(new Point(0.0,0.0), 2, 5)
ShapeDrawingActor ! new Triangle(new Point(0.0,0.0),
 new Point(1.0,0.0),
 new Point(0.0,1.0))
ShapeDrawingActor ! 3.14159
ShapeDrawingActor ! "exit"

Thanks, Chandra

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52
chandra
  • 1
  • 1
  • Looks like your example comes from "Programming Scala". It's a long way into the book. Why not start with the simpler examples earlier rather than diving straight into actors? – The Archetypal Paul Mar 02 '15 at 10:13
  • Take a look at [IntelliJ IDEA Scala plugin](https://confluence.jetbrains.com/display/SCA/Scala+Plugin+for+IntelliJ+IDEA) as well. Though syntax highlighting have still some problems you can create Scala Scripts. – Nader Ghanbari Mar 03 '15 at 06:02
  • Removed the extra content from the source, changed the case of the I-s. Added Scala-ide tag to reflect the subject of the question. – Gábor Bakos Mar 06 '15 at 19:09

1 Answers1

0

Chandra,

The easiest way for beginners to start with Eclipse is to use the Scala IDE, which is Eclipse pre-configured with Scala.

From there, you can create a new scala project, then right click on the directory where you want your file, to create a new Scala file.

Sonia Hamilton
  • 4,229
  • 5
  • 35
  • 50