I am working on some call by name examples using the REPL and running the same examples in Eclipse.
Here is what in Eclipse:
Scenario 1:
val fun
Scenario 1: As expected. The output is from the first line, not calling the method.
Scenario 2: I don't have Eclipse, but doesn't sound right.
REPL Scenario 1: you can't define a call by name value. what you did is assign the last value of the expression {println("Calling funct")} to funct. That last value is the result of println, which is Unit. So takesFunct receives a thunk that evaluates to just Unit, so nothing is printed.
REPL Scenario 2: As expected