Stream: beginners

Topic: calling closures


view this post on Zulip Brendan Hansknecht (Jul 08 2022 at 22:31):

When it comes to a host calling a closure, they get 3 parameters:
flags, closure data, and output.

Is my understanding accurate that:
flags is inputs,
closure data is captured variables,
and of course output is output.

view this post on Zulip Folkert de Vries (Jul 08 2022 at 22:32):

the flags bit is arbitrary

view this post on Zulip Folkert de Vries (Jul 08 2022 at 22:32):

in elm, your main function, in the most general case, takes some flags to get started

view this post on Zulip Folkert de Vries (Jul 08 2022 at 22:33):

but if on your platform you want to have two initial arguments, you can (or should be able to, I guess this is untested)

view this post on Zulip Brendan Hansknecht (Jul 08 2022 at 22:38):

So flags can be used as a input from the platform if wanted, but also can be used for other things?

view this post on Zulip Folkert de Vries (Jul 08 2022 at 22:41):

I guess? the idea here is that the platform can inject some data

view this post on Zulip Folkert de Vries (Jul 08 2022 at 22:42):

that data can come form the platform itself, or might be produced by other roc functions

view this post on Zulip Brendan Hansknecht (Jul 08 2022 at 22:47):

ok. makes sense


Last updated: Jul 06 2025 at 12:14 UTC