Skip to content

Commit 89b0e90

Browse files
committed
Explain produce function
1 parent 2086748 commit 89b0e90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/copyable_task.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ When run inside a [`TapedTask`](@ref), will immediately yield to the caller, ret
3535
See also: [`Libtask.consume`](@ref)
3636
"""
3737
@noinline function produce(x)
38+
# This function is basically just a placeholder -- it never gets run when a user
39+
# `consume`s a `TapedTask`. Rather, it is transformed into other statements during the
40+
# IR transformation pass below. Think of it more as being a reserved statement (e.g.
41+
# like `return`) rather than a function call.
3842
global __v = 4 # silly side-effect to prevent this call getting constant-folded away. Should really use the effects system.
3943
return x
4044
end

0 commit comments

Comments
 (0)