Re: Writing Program Without main Function

2018-12-08 Thread Samir via Digitalmars-d-learn
On Saturday, 8 December 2018 at 03:30:30 UTC, Jonathan M Davis wrote: There's one main per program, not per module. Where main lives depends on how the program was written, but dub encourages putting it in app.d, because that's what it generates when you create a new dub project. imports then

Re: Writing Program Without main Function

2018-12-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, December 7, 2018 2:42:33 PM MST Samir via Digitalmars-d-learn wrote: > Ok. Upon further investigation, I think I see what is going on. > Most of the repos I am skimming are for this year's Advent of > Code. They structure their repo with an `app.d` file which does > contain a `main`

Re: Writing Program Without main Function

2018-12-07 Thread Samir via Digitalmars-d-learn
Ok. Upon further investigation, I think I see what is going on. Most of the repos I am skimming are for this year's Advent of Code. They structure their repo with an `app.d` file which does contain a `main` function but this program is structured such that it imports the files I was looking

Re: Writing Program Without main Function

2018-12-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, December 7, 2018 2:02:59 PM MST Samir via Digitalmars-d-learn wrote: > Is it possible to write and execute a D program without a main > function? > > Most of my programs will start with some `import` statements, > followed by any functions and then ending with the `main` > function

Re: Writing Program Without main Function

2018-12-07 Thread rikki cattermole via Digitalmars-d-learn
There is always a main function. It doesn't matter in which module its in or language. It just has to exist.