4 ms·
That literally is a function. I guess the important difference is you can easily confirm by inspection that it is only called once? If that's an important prop
by IshKebab 2y ago
That literally is a function. I guess the important difference is you can easily confirm by inspection that it is only called once?
If that's an important property maybe it would be worth supporting an annotation on normal functions to enforce that. I guess you could easily write a linter for that.
- int_19h 2y agoSyntactically it is, but semantically it's really more of an isolated block IMO because not only it's called only once, but that call happens immediately (so no back-and-forth control flow unlike regular functions), and the lambda is not passed anywhere as a value either.