File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,6 @@ Libtask.opaque_closure
15
15
Libtask.misty_closure
16
16
Libtask.optimise_ir!
17
17
Libtask.build_callable
18
+ Libtask.LazyCallable
19
+ Libtask.DynamicCallable
18
20
```
Original file line number Diff line number Diff line change @@ -1018,7 +1018,14 @@ Base.IteratorSize(::Type{<:TapedTask}) = Base.SizeUnknown()
1018
1018
Base. IteratorEltype (:: Type{<:TapedTask} ) = Base. EltypeUnknown ()
1019
1019
1020
1020
"""
1021
+ LazyCallable
1021
1022
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.
1022
1029
"""
1023
1030
mutable struct LazyCallable{sig<: Tuple ,Tret}
1024
1031
mc:: MistyClosure
@@ -1038,6 +1045,12 @@ function construct_callable!(l::LazyCallable{sig}) where {sig}
1038
1045
return nothing
1039
1046
end
1040
1047
1048
+ """
1049
+ DynamicCallable
1050
+
1051
+ Like [`LazyCallable`](@ref), but without any type information. Used to implement
1052
+ dynamic dispatch.
1053
+ """
1041
1054
mutable struct DynamicCallable{V}
1042
1055
cache:: V
1043
1056
end
You can’t perform that action at this time.
0 commit comments