Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

How do people handle name collisions with function defined in other packages?

$
0
0

@pixel27 wrote:

As an example I’m using Cairo to create an image. I defined a method:

using Cairo

function image(size::Int)
   ....
end

This function just does some base work for creating an image of size x size for me. However can’t do that do at:

ERROR: LoadError: error in method definition: function Cairo.image must be explicitly imported to be extended

Okay I don’t know what the image() function in Cairo is or does, but I’m not overridden it, improving it, or calling it. I just wanted to create my own function named “image”.

So do people just change the function definition to:

function Cairo.image(size::Int)

Or renamed their function? Maybe prefix all your function with “my_” or something?

Posts: 14

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles