[Nickle] Re: [AI] Nickle Growing Pains

Keith Packard keithp at keithp.com
Thu Jan 6 12:50:51 PST 2005


Around 15 o'clock on Jan 6, Carl Worth wrote:

> > Because we use 'typedef' to bind the name 'e' to the union type, the value 
> > itself has no referent to that name, only the underlying union type.
> 
> Hmmm...

We don't have names for structures and unions at present, but we could.  
And, we could make them 'type names', something C doesn't do; I suspect 
that's largely because C's typenames are unscoped.

So, you could declare:

	enum e { a, b, c };

and nickle could then print out the enum typename along with the tag:

	e.a

Of course, if you used a typedef:

	typedef enum { a, b, c } foo;

then there would be no name to print.  We could print out the value as:

	(enum { a, b, c }).a

in that case, which might encourage people to provide typenames...

-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/20050106/a1a3e59b/attachment.pgp


More information about the Nickle mailing list