[julia-users] Re: Project organization and variable scope question

2016-11-21 Thread Nicholas Mueschke
Ralph... thanks for the clarifications and suggestions. I'll test them out. Nick On Saturday, November 19, 2016 at 11:47:23 AM UTC-6, Ralph Smith wrote: > > Unlike Matlab, Julia doesn't give special treatment to script files. > By "script" we usually mean a file containing a series of

[julia-users] Re: Project organization and variable scope question

2016-11-19 Thread Ralph Smith
Unlike Matlab, Julia doesn't give special treatment to script files. By "script" we usually mean a file containing a series of expressions (which can include type and function definitions) intended for evaluation in the Main module. The Main module is where expressions typed interactively at the

[julia-users] Re: Project organization

2015-03-05 Thread Avik Sengupta
Sorry , I missed this reponse... $ julia MajorCalculations.jl configuration.txt data.txt Well, you can certainly run it like that, even if this is a package. You would write code to handle the parsing of the command line arguments (potentially using ArgParse.jl) .. As I said, a package is

[julia-users] Re: Project organization

2015-02-23 Thread Marc Gallant
Thanks for your input. I have some questions about your reply: 4. Yes, putting constants in global scope is fine. I believe there will not be a performance issue is you mark the variables as const How do I load the configuration file if Major Calculations is a package? using

[julia-users] Re: Project organization

2015-02-23 Thread Avik Sengupta
So I am not sure there are cannonical answers to some of these questions, but I'll try to address some of them based of my current opininions. So imho, and fwiw etc... 1. Major Calculations should mostly be a package. A package is not necessarily a library, it is a self contained unit of code

Re: [julia-users] Re: Project organization and CLI

2014-06-18 Thread Stefan Karpinski
It's not uncommon in Julia to have stateless empty types just for dispatch. The real question here is whether the report verb really means the same thing or not for n-grams and words. If they're different variations on the same meaning, then the two methods should belong to the same generic

Re: [julia-users] Re: Project organization and CLI

2014-06-17 Thread TR NS
On Monday, June 16, 2014 4:44:11 PM UTC-4, Stefan Karpinski wrote: Generic functions are the reason this issue is less pressing in Julia. Instead of Ngrams.report and Words.report or ngramsreport and wordsreport, you can have report(x::Ngrams, ...) and report(x::Words, ...) – Ngrams,

[julia-users] Re: Project organization and CLI

2014-06-17 Thread yfractal
Hope i understand your question :) I think this may be related the pwd. I create a bin directory, and touch corpus and the in the corpus I write ``` println(the pwd is:) println(pwd()) println(the code/clj.lj is:) println(joinpath(pwd(),../)) ``` Then i run the file by ` julia bin/corpus `

[julia-users] Re: Project organization and CLI

2014-06-16 Thread TR NS
Made a modicum of progress. I am not sure why, but it stopped hanging, and now I get a warning. replacing module Corpus and then an error that is can't find Ngrams. My `ngrams.jl` file starts out: module Corpus module Ngrams And now I am pretty sure I totally don't understand how

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread Leah Hanson
`include` is like copy-pasting the code from the included file into the spot where you called include. You shouldn't have `module Corpus` in ngrams.jl. -- Leah On Mon, Jun 16, 2014 at 11:53 AM, TR NS transf...@gmail.com wrote: Made a modicum of progress. I am not sure why, but it stopped

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread TR NS
On Monday, June 16, 2014 12:56:29 PM UTC-4, Leah Hanson wrote: `include` is like copy-pasting the code from the included file into the spot where you called include. You shouldn't have `module Corpus` in ngrams.jl. Thanks. That helps me understand include(). Unfortunately it doesn't seem

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread Leah Hanson
Could you post a gist with all the files? (https://gist.github.com/) It would be easier to understand what's going on if I could see the whole thing. Have you tried switching the order of the imports? `cli.jl` won't be able to see `ngrams.jl` if all of cli is included run first, before ngrams is

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread TR NS
You can see the project here: https://github.com/openbohemians/corpus But I've now changed the code to get it to work. I just had to throw the `Corpus` module out the window and include `ngrams.jl` directly into `cli.jl`. That works, but it doesn't get me anywhere with designing more

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread Stefan Karpinski
There's significantly less need for fine-grained modules in Julia. Is the lack of submodules causing some kind of problem or just discomfort at their absence? On Mon, Jun 16, 2014 at 2:56 PM, TR NS transf...@gmail.com wrote: You can see the project here:

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread TR NS
On Monday, June 16, 2014 3:07:36 PM UTC-4, Stefan Karpinski wrote: There's significantly less need for fine-grained modules in Julia. Is the lack of submodules causing some kind of problem or just discomfort at their absence? Is there? I always appreciated code that broke things up into

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread Stefan Karpinski
Generic functions are the reason this issue is less pressing in Julia. Instead of Ngrams.report and Words.report or ngramsreport and wordsreport, you can have report(x::Ngrams, ...) and report(x::Words, ...) – Ngrams, Words and report can all live in the same namespace without any issues and the

Re: [julia-users] Re: Project organization and CLI

2014-06-16 Thread Stefan Karpinski
You should definitely not include the same code many times – in that case, what you need is a module that all the users use. On Mon, Jun 16, 2014 at 4:43 PM, Stefan Karpinski ste...@karpinski.org wrote: Generic functions are the reason this issue is less pressing in Julia. Instead of