Hello all,
I've a small question where I want to know what is processed first in
the following line
$my-object.?"my-method"(some-complex-argument-calculation())
Will the sub 'some-complex-argument-calculation()' always be run even
when 'my-method' is not available because the sub must be executed
before the method is called.
In the REPL the sub is called despite a method is not defined. Is it
also true when compiling?
> class Y { method y (Int $y) {note $y}}
(Y)
> my Y $y .= new
Y.new
>sub b (Int $i --> Int) { note "$i"; $i + 10 }
&b
> b(10)
10
20
> $y.?y(b(10))
10
20
True
> $y.?undef(b(10))
10
Nil
Regards
Marcel