January 2020
Intermediate to advanced
532 pages
13h 31m
English
A development environment can often help a programmer to enter field names correctly. In the Julia REPL, when I press the Tab key twice after entering the dot character, it will try to autocomplete and display the available field names:

Now that we have implemented the getproperty and setproperty! functions, the list is no longer accurate. More specifically, the loaded field should not be displayed because it can neither be accessed nor changed. In order to fix this, we can simply extend the propertynames function, as follows:
function Base.propertynames(fc::FileContent) return (:path, :contents)end
The propertynames ...
Read now
Unlock full access