```val instance:OnlyAudioRecorder by lazy (mode = ...
# announcements
i
Copy code
val instance:OnlyAudioRecorder by lazy (mode = LazyThreadSafetyMode.SYNCHRONIZED){
         OnlyAudioRecorder(h,k)}
// what does by lazy (mode = ...) { ... } mean?  should lazy take a lambda? but (...) {...} is not a lambda
n
lazy
is a method that takes an optional argument (
mode
) and a lambda.
also the default mode is synchronized so it doesn't actually do anything here
i
@nanodeath you mean it's actually
Copy code
lazy(mode=..., {...})?
n
exactly
your initial example was a little confusing due to the whitespace after
lazy
-- I'd normally say
lazy(...) { ... }
, but maybe that's irrelevant 🤷‍♂️
i
@nanodeath weird syntax, I know f({lambda}) could be f { lambda }, I don't know f(x, {lambda}) could be f (x) {lambda}
@nanodeath f(a) could be f a in other languages, so some time I use f (a)
n
Ruby does this too, fwiw. anyway you can read more in the docs
e
swift as well
v
Groovy too