Index: libcfa/src/containers/array.hfa
===================================================================
--- libcfa/src/containers/array.hfa	(revision 72b5805eebfcce6b1f39679ab3e5ffdda0cb2b5c)
+++ libcfa/src/containers/array.hfa	(revision d1abc63c48f98806d5c9e03885a976c82352ee4e)
@@ -27,5 +27,5 @@
     // -  Given bug of Trac #247, CFA gives sizeof expressions type unsigned long int, when it
     //    should give them type size_t.
-    //    
+    //
     //                          gcc -m32         cfa -m32 given bug         gcc -m64
     // ptrdiff_t                int              int                        long int
@@ -39,5 +39,15 @@
     }
 
+    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, int i ) {
+        assert( i < N );
+        return (Timmed &) a.strides[i];
+    }
+
     static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned int i ) {
+        assert( i < N );
+        return (Timmed &) a.strides[i];
+    }
+
+    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, unsigned int i ) {
         assert( i < N );
         return (Timmed &) a.strides[i];
@@ -49,5 +59,15 @@
     }
 
+    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, long int i ) {
+        assert( i < N );
+        return (Timmed &) a.strides[i];
+    }
+
     static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned long int i ) {
+        assert( i < N );
+        return (Timmed &) a.strides[i];
+    }
+
+    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, unsigned long int i ) {
         assert( i < N );
         return (Timmed &) a.strides[i];
@@ -83,5 +103,5 @@
     // Make a FOREACH macro
     #define FE_0(WHAT)
-    #define FE_1(WHAT, X) WHAT(X) 
+    #define FE_1(WHAT, X) WHAT(X)
     #define FE_2(WHAT, X, ...) WHAT(X)FE_1(WHAT, __VA_ARGS__)
     #define FE_3(WHAT, X, ...) WHAT(X)FE_2(WHAT, __VA_ARGS__)
@@ -90,5 +110,5 @@
     //... repeat as needed
 
-    #define GET_MACRO(_0,_1,_2,_3,_4,_5,NAME,...) NAME 
+    #define GET_MACRO(_0,_1,_2,_3,_4,_5,NAME,...) NAME
     #define FOR_EACH(action,...) \
     GET_MACRO(_0,__VA_ARGS__,FE_5,FE_4,FE_3,FE_2,FE_1,FE_0)(action,__VA_ARGS__)
@@ -115,5 +135,5 @@
 }
 
-#else 
+#else
 
 // Workaround form.  Listing all possibilities up to 4 dims.
Index: libcfa/src/parseargs.cfa
===================================================================
--- libcfa/src/parseargs.cfa	(revision 72b5805eebfcce6b1f39679ab3e5ffdda0cb2b5c)
+++ libcfa/src/parseargs.cfa	(revision d1abc63c48f98806d5c9e03885a976c82352ee4e)
@@ -50,10 +50,12 @@
 extern char ** cfa_args_envp __attribute__((weak));
 
-static void usage(char * cmd, cfa_option options[], size_t opt_count, const char * usage, FILE * out)  __attribute__ ((noreturn));
+forall([N])
+static void usage(char * cmd, const array( cfa_option, N ) & options, const char * usage, FILE * out)  __attribute__ ((noreturn));
 //-----------------------------------------------------------------------------
 // checking
-static void check_args(cfa_option options[], size_t opt_count) {
-	for(i; opt_count) {
-		for(j; opt_count) {
+forall([N])
+static void check_args( const array( cfa_option, N ) & options ) {
+	for(i; N) {
+		for(j; N) {
 			if(i == j) continue;
 
@@ -70,94 +72,101 @@
 //-----------------------------------------------------------------------------
 // Parsing args
-void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ) {
-	if( 0p != &cfa_args_argc ) {
-		parse_args(cfa_args_argc, cfa_args_argv, options, opt_count, usage, left );
-	}
-	else {
-		char * temp = "";
-		parse_args(0, &temp, options, opt_count, usage, left );
-	}
-}
-
-void parse_args(
-	int argc,
-	char * argv[],
-	cfa_option options[],
-	size_t opt_count,
-	const char * usage,
-	char ** & left
-) {
-	check_args(options, opt_count);
-
-	int maxv = 'h';
-	char optstring[(opt_count * 3) + 2] = { '\0' };
-	{
-		int idx = 0;
-		for(i; opt_count) {
-			if (options[i].short_name) {
-				maxv = max(options[i].short_name, maxv);
-				optstring[idx] = options[i].short_name;
-				idx++;
-				if(    ((intptr_t)options[i].parse) != ((intptr_t)parse_settrue)
-				&& ((intptr_t)options[i].parse) != ((intptr_t)parse_setfalse) ) {
-					optstring[idx] = ':';
+forall([opt_count]) {
+	void parse_args( const array( cfa_option, opt_count ) & options, const char * usage, char ** & left ) {
+		if( 0p != &cfa_args_argc ) {
+			parse_args(cfa_args_argc, cfa_args_argv, options, usage, left );
+		}
+		else {
+			char * temp = "";
+			parse_args(0, &temp, options, usage, left );
+		}
+	}
+
+	void parse_args(
+		int argc,
+		char * argv[],
+		const array( cfa_option, opt_count ) & options,
+		const char * usage,
+		char ** & left
+	) {
+		check_args(options);
+
+		int maxv = 'h';
+		char optstring[(opt_count * 3) + 2] = { '\0' };
+		{
+			int idx = 0;
+			for(i; opt_count) {
+				if (options[i].short_name) {
+					maxv = max(options[i].short_name, maxv);
+					optstring[idx] = options[i].short_name;
+					idx++;
+					if(    ((intptr_t)options[i].parse) != ((intptr_t)parse_settrue)
+					&& ((intptr_t)options[i].parse) != ((intptr_t)parse_setfalse) ) {
+						optstring[idx] = ':';
+						idx++;
+					}
+				}
+			}
+			optstring[idx+0] = 'h';
+			optstring[idx+1] = '\0';
+		}
+
+		struct option optarr[opt_count + 2];
+		{
+			int idx = 0;
+			for(i; opt_count) {
+				if(options[i].long_name) {
+					// we don't have the mutable keyword here, which is really what we would want
+					int & val_ref = (int &)(const int &)options[i].val;
+					val_ref = (options[i].short_name != '\0') ? ((int)options[i].short_name) : ++maxv;
+
+					optarr[idx].name = options[i].long_name;
+					optarr[idx].flag = 0p;
+					optarr[idx].val  = options[i].val;
+					if(    ((intptr_t)options[i].parse) == ((intptr_t)parse_settrue)
+					|| ((intptr_t)options[i].parse) == ((intptr_t)parse_setfalse) ) {
+						optarr[idx].has_arg = no_argument;
+					} else {
+						optarr[idx].has_arg = required_argument;
+					}
 					idx++;
 				}
 			}
-		}
-		optstring[idx+0] = 'h';
-		optstring[idx+1] = '\0';
-	}
-
-	struct option optarr[opt_count + 2];
-	{
-		int idx = 0;
-		for(i; opt_count) {
-			if(options[i].long_name) {
-				options[i].val = (options[i].short_name != '\0') ? ((int)options[i].short_name) : ++maxv;
-				optarr[idx].name = options[i].long_name;
-				optarr[idx].flag = 0p;
-				optarr[idx].val  = options[i].val;
-				if(    ((intptr_t)options[i].parse) == ((intptr_t)parse_settrue)
-				    || ((intptr_t)options[i].parse) == ((intptr_t)parse_setfalse) ) {
-					optarr[idx].has_arg = no_argument;
-				} else {
-					optarr[idx].has_arg = required_argument;
-				}
-				idx++;
+			optarr[idx+0].[name, has_arg, flag, val] = ["help", no_argument, 0, 'h'];
+			optarr[idx+1].[name, has_arg, flag, val] = [0, no_argument, 0, 0];
+		}
+
+		FILE * out = stderr;
+		NEXT_ARG:
+		for() {
+			int idx = 0;
+			int opt = getopt_long(argc, argv, optstring, optarr, &idx);
+			switch(opt) {
+				case -1:
+					if(&left != 0p) left = argv + optind;
+					return;
+				case 'h':
+					out = stdout;
+				case '?':
+					usage(argv[0], options, usage, out);
+				default:
+					for(i; opt_count) {
+						if(opt == options[i].val) {
+							const char * arg = optarg ? optarg : "";
+							if( arg[0] == '=' ) { arg++; }
+							// work around for some weird bug
+							void * variable = options[i].variable;
+							bool (*parse_func)(const char *, void * ) = options[i].parse;
+							bool success = parse_func( arg, variable );
+							if(success) continue NEXT_ARG;
+
+							fprintf(out, "Argument '%s' for option %c could not be parsed\n\n", arg, (char)opt);
+							usage(argv[0], options, usage, out);
+						}
+					}
+					abort("Internal parse arg error\n");
 			}
-		}
-		optarr[idx+0].[name, has_arg, flag, val] = ["help", no_argument, 0, 'h'];
-		optarr[idx+1].[name, has_arg, flag, val] = [0, no_argument, 0, 0];
-	}
-
-	FILE * out = stderr;
-	NEXT_ARG:
-	for() {
-		int idx = 0;
-		int opt = getopt_long(argc, argv, optstring, optarr, &idx);
-		switch(opt) {
-			case -1:
-				if(&left != 0p) left = argv + optind;
-				return;
-			case 'h':
-				out = stdout;
-			case '?':
-				usage(argv[0], options, opt_count, usage, out);
-			default:
-				for(i; opt_count) {
-					if(opt == options[i].val) {
-						const char * arg = optarg ? optarg : "";
-						if( arg[0] == '=' ) { arg++; }
-						bool success = options[i].parse( arg, options[i].variable );
-						if(success) continue NEXT_ARG;
-
-						fprintf(out, "Argument '%s' for option %c could not be parsed\n\n", arg, (char)opt);
-						usage(argv[0], options, opt_count, usage, out);
-					}
-				}
-				abort("Internal parse arg error\n");
-		}
-
+
+		}
 	}
 }
@@ -222,15 +231,28 @@
 
 void print_args_usage(cfa_option options[], size_t opt_count, const char * usage, bool error)  __attribute__ ((noreturn)) {
-	usage(cfa_args_argv[0], options, opt_count, usage, error ? stderr : stdout);
+	const array( cfa_option, opt_count ) & arr = (const array( cfa_option, opt_count ) &) *options;
+	usage(cfa_args_argv[0], arr, usage, error ? stderr : stdout);
 }
 
 void print_args_usage(int , char * argv[], cfa_option options[], size_t opt_count, const char * usage, bool error)  __attribute__ ((noreturn)) {
-	usage(argv[0], options, opt_count, usage, error ? stderr : stdout);
-}
-
-static void usage(char * cmd, cfa_option options[], size_t opt_count, const char * help, FILE * out) __attribute__((noreturn)) {
+	const array( cfa_option, opt_count ) & arr = (const array( cfa_option, opt_count ) &) *options;
+	usage(argv[0], arr, usage, error ? stderr : stdout);
+}
+
+forall( [N] ) {
+	void print_args_usage( const array(cfa_option, N ) & options, const char * usage, bool error) {
+		usage(cfa_args_argv[0], options, usage, error ? stderr : stdout);
+	}
+
+	void print_args_usage(int argc, char * argv[], const array( cfa_option, N ) & options, const char * usage, bool error) {
+		usage(argv[0], options, usage, error ? stderr : stdout);
+	}
+}
+
+forall([N])
+static void usage(char * cmd, const array( cfa_option, N ) & options, const char * help, FILE * out) __attribute__((noreturn)) {
 	int width = 0;
 	{
-		for(i; opt_count) {
+		for(i; N) {
 			if(options[i].long_name) {
 				int w = strlen(options[i].long_name);
@@ -251,5 +273,5 @@
 	fprintf(out, "Usage:\n  %s %s\n", cmd, help);
 
-	for(i; opt_count) {
+	for(i; N) {
 		printopt(out, width, max_width, options[i].short_name, options[i].long_name, options[i].help);
 	}
Index: libcfa/src/parseargs.hfa
===================================================================
--- libcfa/src/parseargs.hfa	(revision 72b5805eebfcce6b1f39679ab3e5ffdda0cb2b5c)
+++ libcfa/src/parseargs.hfa	(revision d1abc63c48f98806d5c9e03885a976c82352ee4e)
@@ -16,11 +16,13 @@
 #pragma once
 
+#include <array.hfa>
+
 struct cfa_option {
-      int val; // reserved
-      char short_name;
-      const char * long_name;
-      const char * help;
-      void * variable;
-      bool (*parse)(const char *, void * );
+	int val; // reserved
+	char short_name;
+	const char * long_name;
+	const char * help;
+	void * variable;
+	bool (*parse)(const char *, void * );
 };
 
@@ -31,20 +33,20 @@
 forall(T & | { bool parse(const char *, T & ); })
 static inline void ?{}( cfa_option & this, char short_name, const char * long_name, const char * help, T & variable ) {
-      this.val        = 0;
-      this.short_name = short_name;
-      this.long_name  = long_name;
-      this.help       = help;
-      this.variable   = (void*)&variable;
-      this.parse      = (bool (*)(const char *, void * ))parse;
+	this.val        = 0;
+	this.short_name = short_name;
+	this.long_name  = long_name;
+	this.help       = help;
+	this.variable   = (void*)&variable;
+	this.parse      = (bool (*)(const char *, void * ))parse;
 }
 
 forall(T &)
 static inline void ?{}( cfa_option & this, char short_name, const char * long_name, const char * help, T & variable, bool (*parse)(const char *, T & )) {
-      this.val        = 0;
-      this.short_name = short_name;
-      this.long_name  = long_name;
-      this.help       = help;
-      this.variable   = (void*)&variable;
-      this.parse      = (bool (*)(const char *, void * ))parse;
+	this.val        = 0;
+	this.short_name = short_name;
+	this.long_name  = long_name;
+	this.help       = help;
+	this.variable   = (void*)&variable;
+	this.parse      = (bool (*)(const char *, void * ))parse;
 }
 
@@ -52,6 +54,16 @@
 void parse_args( int argc, char * argv[], cfa_option options[], size_t opt_count, const char * usage, char ** & left );
 
+forall( [N] ) {
+	void parse_args( const array( cfa_option, N ) & options, const char * usage, char ** & left );
+	void parse_args( int argc, char * argv[], const array( cfa_option, N ) & options, const char * usage, char ** & left );
+}
+
 void print_args_usage(cfa_option options[], size_t opt_count, const char * usage, bool error)  __attribute__ ((noreturn));
 void print_args_usage(int argc, char * argv[], cfa_option options[], size_t opt_count, const char * usage, bool error)  __attribute__ ((noreturn));
+
+forall( [N] ) {
+	void print_args_usage( const array(cfa_option, N ) & options, const char * usage, bool error)  __attribute__ ((noreturn));
+	void print_args_usage(int argc, char * argv[], const array( cfa_option, N ) & options, const char * usage, bool error)  __attribute__ ((noreturn));
+}
 
 bool parse_yesno    (const char *, bool & );
Index: tests/configs/parsebools.cfa
===================================================================
--- tests/configs/parsebools.cfa	(revision 72b5805eebfcce6b1f39679ab3e5ffdda0cb2b5c)
+++ tests/configs/parsebools.cfa	(revision d1abc63c48f98806d5c9e03885a976c82352ee4e)
@@ -15,6 +15,6 @@
 //
 
+#include <fstream.hfa>
 #include <parseargs.hfa>
-#include <fstream.hfa>
 
 #include "../meta/fork+exec.hfa"
@@ -30,16 +30,14 @@
 	bool sf = true;
 
-	cfa_option options[] = {
-		{'e', "yesno",     "test yes/no",     YN, parse_yesno},
-		{'y', "YN",        "test yes/no",     Yn, parse_yesno},
-		{'n', "yn",        "test yes/no",     yn, parse_yesno},
-		{'t', "truefalse", "test true/false", tf, parse_truefalse},
-		{'s', "settrue",   "test set true",   st, parse_settrue},
-		{'u', "setfalse",  "test set false",  sf, parse_setfalse},
-	};
-	int options_cnt = sizeof(options) / sizeof(cfa_option);
+	array( cfa_option, 6 ) options;
+	options[0] = (cfa_option){'e', "yesno",     "test yes/no",     YN, parse_yesno};
+	options[1] = (cfa_option){'y', "YN",        "test yes/no",     Yn, parse_yesno};
+	options[2] = (cfa_option){'n', "yn",        "test yes/no",     yn, parse_yesno};
+	options[3] = (cfa_option){'t', "truefalse", "test true/false", tf, parse_truefalse};
+	options[4] = (cfa_option){'s', "settrue",   "test set true",   st, parse_settrue};
+	options[5] = (cfa_option){'u', "setfalse",  "test set false",  sf, parse_setfalse};
 
 	char **left;
-	parse_args( options, options_cnt, "[OPTIONS]...\ntesting bool parameters", left);
+	parse_args( options, "[OPTIONS]...\ntesting bool parameters", left);
 
 	sout | "yes/no     :" | YN;
Index: tests/configs/parsenums.cfa
===================================================================
--- tests/configs/parsenums.cfa	(revision 72b5805eebfcce6b1f39679ab3e5ffdda0cb2b5c)
+++ tests/configs/parsenums.cfa	(revision d1abc63c48f98806d5c9e03885a976c82352ee4e)
@@ -15,6 +15,6 @@
 //
 
+#include <fstream.hfa>
 #include <parseargs.hfa>
-#include <fstream.hfa>
 
 #include "../meta/fork+exec.hfa"
@@ -42,15 +42,13 @@
 
 
-	cfa_option options[] = {
-		{ 'i', "int",              "test int",                i   },
-		{ 'u', "unsigned",         "test unsigned",           u   },
-		{ 'l', "unsignedlong",     "test unsigned long",      ul  },
-		{ 'L', "unsignedlonglong", "test unsigned long long", ull },
-		{ 'd', "double",           "test double",             d   },
-	};
-	int options_cnt = sizeof(options) / sizeof(cfa_option);
+	array( cfa_option, 5 ) options;
+	options[0] = (cfa_option){ 'i', "int",              "test int",                i   };
+	options[1] = (cfa_option){ 'u', "unsigned",         "test unsigned",           u   };
+	options[2] = (cfa_option){ 'l', "unsignedlong",     "test unsigned long",      ul  };
+	options[3] = (cfa_option){ 'L', "unsignedlonglong", "test unsigned long long", ull };
+	options[4] = (cfa_option){ 'd', "double",           "test double",             d   };
 
 	char **left;
-	parse_args( options, options_cnt, "[OPTIONS]...\ntesting bool parameters", left);
+	parse_args( options, "[OPTIONS]...\ntesting bool parameters", left);
 
 	sout | "int                :" | i;
Index: tests/configs/usage.cfa
===================================================================
--- tests/configs/usage.cfa	(revision 72b5805eebfcce6b1f39679ab3e5ffdda0cb2b5c)
+++ tests/configs/usage.cfa	(revision d1abc63c48f98806d5c9e03885a976c82352ee4e)
@@ -15,6 +15,6 @@
 //
 
+#include <fstream.hfa>
 #include <parseargs.hfa>
-#include <fstream.hfa>
 
 #include "../meta/fork+exec.hfa"
@@ -25,6 +25,6 @@
 	sout | "No args, no errors";
 	if(pid_t child = strict_fork(); child == 0) {
-		cfa_option opts[0];
-		print_args_usage(1, fake_argv, opts, 0, "Test usage", false);
+		array( cfa_option, 0 ) opts;
+		print_args_usage(1, fake_argv, opts, "Test usage", false);
 	}
 	else {
@@ -35,6 +35,6 @@
 	sout | "No args, with errors";
 	if(pid_t child = strict_fork(); child == 0) {
-		cfa_option opts[0];
-		print_args_usage(1, fake_argv, opts, 0, "Test usage", true);
+		array( cfa_option, 0 ) opts;
+		print_args_usage(1, fake_argv, opts, "Test usage", true);
 	}
 	else {
@@ -46,10 +46,9 @@
 	if(pid_t child = strict_fork(); child == 0) {
 		int a, b, c;
-		cfa_option opts[] = {
-			{'a', "", "First arg", a },
-			{'b', "", "Second arg", b },
-			{'c', "", "Third arg", c },
-		};
-		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+		array( cfa_option, 3 ) opts;
+		opts[0] = (cfa_option){'a', "", "First arg", a };
+		opts[1] = (cfa_option){'b', "", "Second arg", b };
+		opts[2] = (cfa_option){'c', "", "Third arg", c };
+		print_args_usage(1, fake_argv, opts, "Test usage", false);
 	}
 	else {
@@ -61,10 +60,9 @@
 	if(pid_t child = strict_fork(); child == 0) {
 		int a, b, c;
-		cfa_option opts[] = {
-			{'\0', "AA", "First arg", a },
-			{'\0', "BB", "Second arg", b },
-			{'\0', "CC", "Third arg", c },
-		};
-		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+		array( cfa_option, 3 ) opts;
+		opts[0] = (cfa_option){'\0', "AA", "First arg", a };
+		opts[1] = (cfa_option){'\0', "BB", "Second arg", b };
+		opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
+		print_args_usage(1, fake_argv, opts, "Test usage", false);
 	}
 	else {
@@ -76,10 +74,9 @@
 	if(pid_t child = strict_fork(); child == 0) {
 		int a, b, c;
-		cfa_option opts[] = {
-			{'a', "", "First arg", a },
-			{'b', "BBBB", "Second arg", b },
-			{'\0', "CC", "Third arg", c },
-		};
-		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+		array( cfa_option, 3 ) opts;
+		opts[0] = (cfa_option){'a', "", "First arg", a };
+		opts[1] = (cfa_option){'b', "BBBB", "Second arg", b };
+		opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
+		print_args_usage(1, fake_argv, opts, "Test usage", false);
 	}
 	else {
@@ -91,10 +88,9 @@
 	if(pid_t child = strict_fork(); child == 0) {
 		int a, b, c;
-		cfa_option opts[] = {
-			{'a', "", "First arg", a },
-			{'b', "BBBB", "", b },
-			{'\0', "CC", "Third arg", c },
-		};
-		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+		array( cfa_option, 3 ) opts;
+		opts[0] = (cfa_option){'a', "", "First arg", a };
+		opts[1] = (cfa_option){'b', "BBBB", "", b };
+		opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
+		print_args_usage(1, fake_argv, opts, "Test usage", false);
 	}
 	else {
@@ -106,10 +102,9 @@
 	if(pid_t child = strict_fork(); child == 0) {
 		int a, b, c;
-		cfa_option opts[] = {
-			{'a', "", "First arg\nThe description has multiple lines,\n...for some reason", a },
-			{'b', "BBBB", "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", b },
-			{'\0', "CC", "Third arg", c },
-		};
-		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+		array( cfa_option, 3 ) opts;
+		opts[0] = (cfa_option){'a', "", "First arg\nThe description has multiple lines,\n...for some reason", a };
+		opts[1] = (cfa_option){'b', "BBBB", "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", b };
+		opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
+		print_args_usage(1, fake_argv, opts, "Test usage", false);
 	}
 	else {
