diff --git a/paper/code/mutability.jl b/paper/code/mutability.jl deleted file mode 100644 index b92ca7f..0000000 --- a/paper/code/mutability.jl +++ /dev/null @@ -1,13 +0,0 @@ -mutability(::Type) = IsNotMutable() -function mutability( - T::Type, - op::Function, - args::Type..., -) - if mutability(T) isa IsMutable && - T == promote_operation(op, args...) - return IsMutable() - else - return IsNotMutable() - end -end diff --git a/paper/paper.tex b/paper/paper.tex index dfe66b1..20de2e8 100644 --- a/paper/paper.tex +++ b/paper/paper.tex @@ -225,7 +225,17 @@ \subsection{Mutability fallback} returns \lstinline|IsMutable()| if \lstinline|T| is in the first category and \lstinline|IsNotMutable()| if \lstinline|T| is in the second category. Then we have the following fallback for \lstinline|mutability|: -\jlinputlisting{code/mutability.jl} +\begin{jllisting} +mutability(::Type) = IsNotMutable() +function mutability(T::Type, op::Function, args::Type...) + if mutability(T) isa IsMutable && + T == promote_operation(op, args...) + return IsMutable() + else + return IsNotMutable() + end +end +\end{jllisting} \subsection{Minimal interface} In summary, for a type \lstinline|Foo| to implement the interface,