Structuring a library project—best practices?

Joel C. Salomon joelcsalomon at gmail.com
Wed Feb 11 11:39:00 PST 2009


I’m starting work on my Geometric Algebra library
<http://www.dsource.org/projects/gald>, and I’d like some tips on
structuring the source tree. Is there a “standard” place to put the
library test/demonstration?

Right now I’m starting with:

trunk/
      gald/
           e2.d
      test.d
      dsss.conf

with the files as follows:

e2.d:
	module gald.e2;

	struct vector2 {
		real x;
		real y;
	}

test.d:
	module test;

	import gald.e2;

	int main(char[][] args) {
		vector2 v;
		return 0;
	}

dsss.conf:
	name=gald
	[gald]
	[test.d]
	target=test_gald

Is this a reasonable start, or am I buying trouble for myself with the
layout and module declarations? What are the “best practices” for such a
project?

—Joel Salomon


More information about the Digitalmars-d-learn mailing list