diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-04-05 12:29:23 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-04-05 12:30:24 -0400 |
commit | ace2fe485cc46c67fc425a6c4632f2a1ce606c88 (patch) | |
tree | b396b9ae19258fb38b6836e502bb5b0688f04d24 /README.md | |
parent | b20c077ec646fdc2612e31f3305e8cfcedae207b (diff) | |
download | PyX.jl-ace2fe485cc46c67fc425a6c4632f2a1ce606c88.tar.gz PyX.jl-ace2fe485cc46c67fc425a6c4632f2a1ce606c88.zip |
document dot/underline difficulties with objects
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -74,12 +74,25 @@ All the expected [Julia/Python differences][1] apply: Note that the string code snippets that go into `graph_data_function` are still Python code, not Julia. -There doesn't seem to be an easy way to handle nested Python modules as nested -modules in Julia, so there can only be a single `.` separator in variable and -function names. This has been worked around by using the underscore character -(`_`) instead of `.` for all but the last separator. So, eg, -`graph_axis.split()` instead of `graph.axis.split()` and `color_rgb.red` -instead of `color.rgb.red`. +Because the Python syntax features for objects (they can both be accessed like +a module or called like a function) does not map to any Julia type at this +time, a naming convention is used such that only a single `.` separator is used +in Julia names and calls, and underscore characters (`_`) are used in +objects-as-modules to access attributes. For example: + + python> from pyx import style, color, graph + python> style.linewidth.THICK + python> style.linewidth(0.5) + python> color.rgb.red + python> graph.axis.split() + + julia> using PyX + julia> style_linewidth.THICK + julia> style.linewidth(0.5) + julia> color_rgb.red + julia> graph_axis.split() + +See HACKING for more details. To avoid namespace collisions or confusion with built-in Julia functions the following functions (only) have `pyx_` preprended to the function name: |