Preferences

I had a quick skim of the link you gave -- it looks to be the same as it was 6 years ago when I experienced this issue.

So basically:

Generic function F is defined in file A, and has a method definition DEF in file B.

File C imports files A and B, and then calls function G that internally uses generic function F. Somewhere internally, it winds up running F with method definition DEF.

You move DEF to file D, but don't update the imports of file B.

When file B calls G, it calls F with some default implementation instead of DEF, and then you get an error from function G.

Some details here might be wrong over how exactly to imports need to be set up, as I haven't used Julia being traumatized by it 6 years ago, but that's basically it.


Well, with generic programming constructs you have more freedom, and with more freedom you have more ways to shoot yourself in the foot. I don't think Julia has some illogical or inconsistent design decisions of its module system. In fact, it's better than many other because the order in which you import modules doesn't matter.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal