Julia: Official stance on getproperty, setproperty! and propertynames and docs

Created on 16 May 2018  Â·  4Comments  Â·  Source: JuliaLang/julia

It is a bit unclear to me whether those are now the standard way to access type-fields or not? Presumably yes, but then why are they not exported and why are getfield, setfield! and fieldnames still exported if they should not be used? A clear stance on the "official-ness" of those would be good. Maybe pre-0.7 would be good if exports are to be added/removed.

Once that is cleared-up, the docs need updating:
They are missing adequate doc-strings and are almost fully absent from the manual. To cite @stevengj: "We really need more documentation on how to use this, explaining the arguments to getproperty, how to fall back to getfield, implications for performance and type stability, best practices...."
https://github.com/JuliaLang/julia/pull/24960#discussion_r157478864

Also, other places, such as https://docs.julialang.org/en/latest/manual/types/#Composite-Types-1 need updating if "properties" are "official".

doc needs docs

Most helpful comment

Yes, let's just export them.

All 4 comments

Yes, let's just export them.

Triage is in agreement with Jeff here — they just need to be exported and documented.

Added to the milestone since the export needs to be added before 0.7 release.

Maybe this could be kept open for the doc-part? But remove the 1.0 milestone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Keno picture Keno  Â·  3Comments

manor picture manor  Â·  3Comments

i-apellaniz picture i-apellaniz  Â·  3Comments

TotalVerb picture TotalVerb  Â·  3Comments

sbromberger picture sbromberger  Â·  3Comments