On Thu, 2008-07-17 at 20:54 +0000, Eric Rannaud wrote:
> Oh, and there is another case I forget, for which you would need
> language support:
> 
> struct a {
>       int x, y;
> #ifdef DEPRECATED_FEATURE /* too go in 2 revisions */
>       char c;
> #endif
> };

This is definitely not something that should be done with the
preprocessor. In this particular case, what you are looking for is an
annotation.

> Of course, I guess one can do that with type classes. But is it worth
> the trouble? And there is no 'deriving' (cf. Haskell) in BitC, is
> there? 

Not yet, but that is about to be fixed.

> I can't think of a way of doing in BitC, without conditional
> compilation, the equivalent of
> 
> void foo(struct a *a, int p)
> {
>       a->x = p;
>       a->y = 2*p;
> #ifdef DEPRECATED_FEATURE
>       a->c = '0';
> #endif
> }

Or equivalently, some form of clean-ish macro mechanism.

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to