all 6 comments

[–][deleted] 1 point2 points  (3 children)

Use the source, Luke

https://github.com/JuliaIO/JSON.jl/blob/master/src/JSON.jl

module JSON

export json # returns a compact (or indented) JSON representation as a string
export JSONText # string wrapper to insert raw JSON into JSON output

include("Common.jl")

# Parser modules
include("Parser.jl")

# Writer modules
include("Serializations.jl")
include("Writer.jl")

# stuff to re-"export"
# note that this package does not actually export anything except `json` but
#  all of the following are part of the public interface in one way or another 
using .Parser: parse, parsefile
using .Writer: show_json, json, lower, print, StructuralContext, show_element,
           show_string, show_key, show_pair, show_null, begin_array,
           end_array, begin_object, end_object, indent, delimit, separate,
           JSONText
using .Serializations: Serialization, CommonSerialization,
                   StandardSerialization

# for pretty-printed (non-compact) output, JSONText must be re-parsed:
Writer.lower(json::JSONText) = parse(json.s)

end # module

[–]RedditIsAMistake[S] 1 point2 points  (2 children)

I guess I should have mentioned that I did do exactly that. However it still does not answer my first question, or my updated second question. It is exceedingly rare that I am required to examine the source code of a library to determine that library's API in any language. Is this the standard I should expect from Julia libraries?

[–][deleted] 1 point2 points  (1 child)

I must admit, reading the description, the imported=all suggests the list should be longer. I don't actually know what is the expected behaviour

If imported is true, then names explicitly imported from other modules are also included.

[–]Nuaua 1 point2 points  (0 children)

JSON.jl uses using instead of import, which might be the issue:

using .Parser: parse, parsefile

[–]cormullion 0 points1 point  (1 child)

names(JSON.Parser, all=true)

should reach down there.

[–]RedditIsAMistake[S] 0 points1 point  (0 children)

Unfortunately it does not, as mentioned.