[Nickle]New suggestion for comprehensions

Keith Packard nickle@nickle.org
Wed, 07 Aug 2002 00:39:41 -0700


	a) (int[10]) { [i] = i + 1 }

	b) (int[10]) { [i] { return i + 1; } }

Should b) get an '=' operator as well?

This syntax requires a small sacrifice elsewhere in the grammar:

	[10] { 1 ... }

is currently valid, and generates a 10 element array of type poly.  This 
would need to be:

	([10]) { 1 ... }

which is (somewhat) more symmetrical with:

	(poly[10]) { 1 ... }

but has the disadvantage of nesting brackets...

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab