"Sigbjorn Finne (Intl Vendor)" wrote:
> Manuel does highlight a problem, but it's an example of Bad Practice
> on the part of the library provider - rejigging the ordering and mapping
> of enumeration tags is a no-no if you care about backward compatibility.

But there are libraries out there which guarantee only source level
compatibility, and changing the mapping is absolutely valid in those
cases. I really don't advocate random re-mappings, but those things exist
in real life (tm).

> [Do GL enums vary between implementations? I'm surprised]

I was, too, when I first read this (in news:comp.graphics.api.opengl,
I think). Currently it is quite probable that newer implementations
agree on this, but there is no guarantee.

> [...] HDirect could generate output which delayed the binding of enum
> tags to values until the Haskell/C stubs are compiled, if this is a
> real problem. [...]

Following Wadler's Law of Language Design (available at
http://www-i2.informatik.rwth-aachen.de/~hanus/curry/listarchive/0017.html)
we should first agree on the syntax before talking about semantics :-),
so here's my first shot, re-using litlits:

   typedef enum { 
      ExitFailure = ``EXIT_FAILURE'',
      ExitSuccess = ``EXIT_SUCCESS''
   } Status;

or even better:   (almost like Green Card :-)

   typedef enum [useValuesFromHeaderAndDoCunningNameMangling] { 
      EXIT_FAILURE, EXIT_SUCCESS
   } Status;

Would this be hard to integrate?

Cheers,
   Sven
-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne

Reply via email to