I feel we should either differentiate them or integrate them better, they
are not listed anywhere, Steffan provided a complicated way of getting a
list of those:
function builtins()
nams = filter(s -> isdefined(Base, s), names(Base, true, true))
objs = map(s -> Base.(s), nams)
funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), objs)
convert(Vector{Symbol}, sort!(map(symbol, unique(funcs))))
end
julia> builtins()
22-element Array{Symbol,1}:
:_apply
:_expr
:applicable
:apply_type
:arrayref
:arrayset
:arraysize
:fieldtype
:getfield
:invoke
⋮
:isdefined
:issubtype
:kwcall
:nfields
:setfield!
:svec
:throw
:tuple
:typeassert
:typeof
Here: https://groups.google.com/forum/#!topic/julia-users/m_5t0-bIJ8c
I think that it would be possible to change the names of those builtins to
__<name> instead of <name>, and then in boot.jl, have the julian
definitions like <name>(args::types) = __<name>(args). So it would be
possible to extend such functions.
El lunes, 4 de enero de 2016, 23:08:52 (UTC-6), Ismael Venegas Castelló
escribió:
>
>
> - What exactly are these SimpleVectors?
> - Why show them as svec?
> - What's their purpose?
> - How to use SimpleVector constructor manually, without using
> Core.svec?
>
>
> They are not documented at all. All I understand is that they are svec is
> not generic but "intrinsic" / "builtin", I think they are used earlier in
> bootstrap?
>
> Since they don't work with @which, an @whereis kinda macro would be nice
> to give a link to their source code in github, even if it's in C or
> whatever. IMHO we should really differentiate all this "anonymous" (that's
> what typeof tell you) functions and document them.
>
> Couldn't we just wrap them in Julia functions and treat them as the rest?
>
> julia> svec(args...) = Core.svec(args...)
> svec (generic function with 1 method)
>
> julia> svec(1)
> svec(1)
>