6 ms·
You change a function, and that change doesn't get reflected in upstream calls—this isn't a big deal? Are you kidding me?
by Stubb 13y ago
You change a function, and that change doesn't get reflected in upstream calls—this isn't a big deal? Are you kidding me?
- RivieraKid 13y agoI don't see it as a big deal. You do, so my advice is to wait for 1.0.
- Stubb 13y agoExcept that the linked thread on Github mentions that supporting the redefinition of functions isn't a v1.0 issue.
- RivieraKid 13y agoIt's assigned to the 1.0 mileston.
- simonster 13y agoI think everyone involved with Julia agrees that this is something that eventually needs to work, although it is not as big of a deal if you are loading code from disk, as opposed to writing functions at the REPL. See https://github.com/JuliaLang/julia/issues/265 https://github.com/JuliaLang/julia/issues/265.
- Stubb 13y agoThat's the issues thread that I included in my initial post. Quoting from it: "When you redefine a method, the resulting behavior is undefined." And these people expect to be taken seriously? Sell crazy someplace else, we're all stocked up here. The honest approach would be to forbid redefining functions. This issue was brought to my attention by pals who had investigated Julia and rejected it for this very reason. No way I'll use it for anything. And that will be my recommendation to anyone who asks me about it.
- coldtea 13y ago>This issue was brought to my attention by pals who had investigated Julia and rejected it for this very reason. You should pick different advisors.
- Stubb 13y agoNope, I should buy them beers since Julia is wholly unsuited for what I'm trying to do, which is interactive network performance analysis and interactive development of ionospheric ray-tracing code. It's funny: I've forwarded this issue to several pals with experience in language & compiler design, and to a man they were dismayed that something so basic was going unfixed or was even broken in the first place.
- coldtea 13y agoThat's only an issue for quick iterating tests in the REPL. The REPL is not a priority. You're not supposed to rename functions in your code -- are you kidding me you're hang up on this?
- Stubb 13y agoNo kidding—this is a show-stopper for me. I'm running Emacs with a split window for development. R runs in the bottom window, and the source file I'm editing is in the top. This lets me send code to R for evaluation and supports an incremental style of development. I'll slowly build up functions, and this sometimes requires editing functions that my current function uses. This style of development is typical for people using R, Matlab, Lisp, or any language featuring a REPL. But you can't do it in Julia. Julia needs to support this style of development if it's to garner support from people using these languages. Full stop. And the fact that Julia doesn't support updating functions makes me think that something is very broken down in the core of the language. The tone of the GitHub thread is: "We don't know how to fix this." Scary!
- ihnorton 13y agoJulia certainly allows you to redefine functions, it simply doesn't trigger automatic upstream recompilation. https://gist.github.com/anonymous/8656066 https://gist.github.com/anonymous/8656066 > I'm running Emacs with a split window for development. R runs in the bottom window, and the source file I'm editing is in the top. This lets me send code to R for evaluation and supports an incremental style of development. I'll slowly build up functions, and this sometimes requires editing functions that my current function uses. This style of development is typical for people using R, Matlab, Lisp, or any language featuring a REPL. But you can't do it in Julia. This is what everyone does in Julia too, with Emacs, IJulia, and others. Here is how to do it: put "module X" at the beginning of your file, and an extra "end" as the last line. Each time you send the file to Julia, the module is recompiled, and inter-dependent functions are updated to the latest version. Problem solved. This is mentioned (in a slightly different context) in the FAQ: http://docs.julialang.org/en/release-0.2/manual/faq/#how-can-i-modify-the-declaration-of-a-type-immutable-in-my-session http://docs.julialang.org/en/release-0.2/manual/faq/#how-can... But I admit it's not immediately obvious, and we should probably put it front-and-center somewhere.