I have but sadly github sucks at searching, but it's not only that. I think
that all this builtins are treated wrong at several non useful levels, for
example:
julia> methods(is)
ERROR: ArgumentError: argument is not a generic function
in methods at reflection.jl:180
julia> methods(1)
0-element Array{Any,1}
julia> methods("a")
0-element Array{Any,1}
julia> methods('c')
0-element Array{Any,1}
Oh yeah! so svec, `is` and friends are not generic functions, so of course
you cant apply the `methods` function on them, but you can apply it on
integers, strings, chars and anything else? (at least non generic functions
are still kinda functions right?)
Honestly I've been saying WTF a lots of time as I keep experimenting with
them LOL, because, it seems that `is` is not a generic func but literal
integers somehow are no problem to give the impression of being treated as
such?
Builtins are not anonymous functions either, but that is what typeof tells
you, only one can get that error message? I think we should not use the
ones not intended for public consumption after bootstrap if that can be
done, promote the others to generic functions and of course document all of
them either way.
I think this is wrong:
methods(x::ANY) = methods(call, Tuple{isa(x,Type) ? Type{x} : typeof(x),
Vararg{Any}})
form: https://github.com/JuliaLang/julia/blob/master/base/reflection.jl#L193
methods(x::DataType) = ...
Would be better IMHO, less voodoo. Why force `methods` to work with
anything?
As I keep on digging this stuff, my WTF are increasing, documentation
obscurantism doesn't help a bit either :-)
I hope I can understand enough so I can at least make a decent issue, I
don't really know. I could be all wrong and just I just don't get it, but
this smells fishy.
julia> typeof(is)
Function
julia> typeof(Base.svec)
Function
help?> Base.svec
No documentation found.
Core.svec is an *anonymous* Function.
Honeslty I wish that at some point we could devote a whole release cycle to
documentation, another to testing, another for performance, etc, before
continuing to add more stuff. Something like what Linus wanted to do with a
Linux release cycle. Why does femtolisp can't shouldn't be documented also
for example?
>From femtolisp: *This project is mostly a matter of style. Look at the code
and you'll understand. (...yeah sure!)*
Then you find things like
this: https://github.com/JeffBezanson/femtolisp/blob/master/flisp.boot
--------------^
Sorry for the rambling I just found too many twisted things I can
understand for a single night, so I'll call it a day, but I'm truly and
deeply intrigued by this and how to make it better.
El martes, 5 de enero de 2016, 0:39:39 (UTC-6), Mauro escribió:
>
> As far as I understand: svecs are simple indexable containers; they are
> used in bootstrap before arrays are defined. Once arrays are defined
> they are not really useful anymore and thus not intended as a datatype
> for public consumption. Still, they should get some documentation as
> one can stumble upon them. Github may be able to tell you more.
>
> On Tue, 2016-01-05 at 06:08, Ismael Venegas Castelló <[email protected]
> <javascript:>> wrote:
> >
> > - 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)
>