[Nickle] Type flipping or PP flipping bug

Keith Packard keithp at keithp.com
Thu May 20 23:27:27 PDT 2004


Around 14 o'clock on May 13, Bart Massey wrote:

>    > typedef (string[*])(string) bar;
>    > print bar
>    typedef string(string)[*] bar;
>
> Probably an easy fix.

Uhh.  This is a function string -> string[*], right?  Or, in english:

bar is a function taking a string argument and returning an array of 
strings.

The scary(?) thing is that:

	> int(string)[*] foo;
	> int[*] bar (string x) { return (int[*]) { 1, 2, 3 }; }
	> foo = bar
	int[*] func(string x)
	{
	    return (int[*]) { 1, 2, 3 };
	}
	> 

In other words, it's not just the pretty printer which is confused/
confusing.  Our grammar apparently agrees.

I suspect that our fancy flip-the-subscripts rule is the culprit here, and 
I'm not sure turning things back around is a good idea...

-keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : /pipermail/nickle/attachments/20040520/1c0da746/attachment.pgp


More information about the Nickle mailing list