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 & );
