Skip to content

Commit 172e463

Browse files
committed
More docs
1 parent d3b5639 commit 172e463

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docs/src/internals.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ Libtask.opaque_closure
1515
Libtask.misty_closure
1616
Libtask.optimise_ir!
1717
Libtask.build_callable
18+
Libtask.LazyCallable
19+
Libtask.DynamicCallable
1820
```

src/copyable_task.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,14 @@ Base.IteratorSize(::Type{<:TapedTask}) = Base.SizeUnknown()
10181018
Base.IteratorEltype(::Type{<:TapedTask}) = Base.EltypeUnknown()
10191019

10201020
"""
1021+
LazyCallable
10211022
1023+
Used to implement static dispatch, while avoiding the need to construct the
1024+
callable immediately. When constructed, just stores the signature of the
1025+
callable and its return type. Constructs the callable when first called.
1026+
1027+
All type information is known, so it is possible to make this callable type
1028+
stable provided that the return type is concrete.
10221029
"""
10231030
mutable struct LazyCallable{sig<:Tuple,Tret}
10241031
mc::MistyClosure
@@ -1038,6 +1045,12 @@ function construct_callable!(l::LazyCallable{sig}) where {sig}
10381045
return nothing
10391046
end
10401047

1048+
"""
1049+
DynamicCallable
1050+
1051+
Like [`LazyCallable`](@ref), but without any type information. Used to implement
1052+
dynamic dispatch.
1053+
"""
10411054
mutable struct DynamicCallable{V}
10421055
cache::V
10431056
end

0 commit comments

Comments
 (0)