Consider the following four methods:
method foo1 {
object { return "Hello" }
"Goodbye" }
method foo2 {
object { {return "Hello"}.apply }
"Goodbye" }
method foo3 {
object { return "Hello" }}
method foo4 {
object { {return "Hello"}.apply }}
I would expect all 4 methods to return "Hello" when called, however this is not the case:
print(foo1) // prints "Goodbye"
print(foo2) // prints "hello"
print(foo3) // prints "a foo3"
print(foo4) // crashes with:
// RequestError: error on line 18 of module test: undefined
// 17: print(foo3)
// 18: print(foo4)
// minigrace: program test exited with code 3.
Consider the following four methods:
I would expect all 4 methods to return "Hello" when called, however this is not the case: