Scala code as data

Possible duplicate:
"eval" in Scala

R. Subramaniam in his speech http://www.youtube.com/watch?v=LH75sJAR0hc at minute 30, when he starts talking about the functional style in Scala, he gives this example

class Car {
  def turn(direction: String) = {
    println("turning " + direction)
  }
}

val car = new car
car turn "left"

and then he says that the last line can be read from the data file and evaluated. Thus, data becomes code, code becomes data.

How does Scala support? Does it have a function eval?

+3
source share
1 answer

eval ( , , Haskell). , , - (, Lisp - , Erlang Java), () .

, eval.

Scala , JVM .

, (, LLVM).

eval, , , , , , , .

  • , , LISP, SIGPLAN Not. 1978. - eval
+1

All Articles