digitalmars.D.learn - header filed functions
- MM (10/10) May 09 2006 I just got d to run the opengl example (from the very nice Dmedia websit...
- Hasan Aljudy (6/21) May 10 2006 you don't need header, just import the .d file that contains the
- Deewiant (5/8) May 10 2006 You can declare them before defining them, just like in C, if you want t...
I just got d to run the opengl example (from the very nice Dmedia website) Simple things like where to place build and what to put in my path were the most difficult for me as I used to always use a nice IDE for my C programs. (Now I only need to make everything work without dmd having to sit in my root :) but here my question: I used to always put all my functions in separate header files to make everthing clean (this works in an ide) now what is the best way to keep all my functions neat and ordered in D.. or should I just do what I used to do? thx
May 09 2006
MM wrote:I just got d to run the opengl example (from the very nice Dmedia website) Simple things like where to place build and what to put in my path were the most difficult for me as I used to always use a nice IDE for my C programs. (Now I only need to make everything work without dmd having to sit in my root :) but here my question: I used to always put all my functions in separate header files to make everthing clean (this works in an ide) now what is the best way to keep all my functions neat and ordered in D.. or should I just do what I used to do? thxyou don't need header, just import the .d file that contains the function you want. import module_name; just note: the module name is not exactly the file name. (it doesn't include the .d extension)
May 10 2006
MM wrote:now what is the best way to keep all my functions neat and ordered in D.. or should I just do what I used to do?You can declare them before defining them, just like in C, if you want to. This should work both with a separate module for them (the "header") and by writing them in the same module. However, the general style seems to be to just define them as you go.
May 10 2006