In Javascript I can describe a function like so
function showString(){ console.log("this is a string") };
Such that in the console there is a strict difference between the function and the executed function
> function showString(){ console.log("this is a string") };
> showString
function showString(){ console.log("this is a string") }
> showString()
this is a string
In Scala I am now doing the same thing;
def showname() = println("this is a string")
However, when I run this is in the console, it always seems to execute the function instead of also being able to just pass the function around:
scala> def showname() = println("this is a string")
showname: ()Unit
scala> showname // I am expecting a function, not an executed function
this is a string
scala> showname()
this is a string // I am expecting an executed function
Is Scala handling functions differently? Is my expectation wrong?