I came across Base.jl include, and saw this. Since Julia is not OOP, I had never seen this before. The keyword is not even documented, searching gives 0 results. I tested it myself in REPL and this seems to be a reference to the current module (?).
Isnât it just a callable/functor ? See Methods ¡ The Julia Language
For instance, I guess that writing
(dog::IncludeInto)(fname::AbstractString) = include(identity, dog.m, fname)
would also work.
I see, I know callable functors, but using this specifically is really quite confusing at first. I also tested it the wrong way. Thanks!
To be very precise, it is the variable name of the concrete instance of the functor you define. And yes you can name that whatever you like.
tangential, but there are one or two people who will get very bothered if we keep using the term âfunctorâ ![]()
Sured, the docs still say â(sometimes called âfunctorâ)â and I think formerly that was even more prominently called so, so somehow thatâs what got stuck in my head. Will adapt head.