[bitc-dev] BitFields and Integral typeclass

Jonathan S. Shapiro shap at eros-os.org
Sat May 20 06:36:37 EDT 2006


On Sat, 2006-05-20 at 01:24 -0400, Swaroop Sridhar wrote:
> Jonathan S. Shapiro wrote:
> > Actually, I'm not convinced that bitfields should be a member of
> > Integral at all.
> 
> They must be, for the sake of assignment from integer literals.
> 
> For example,
> 
> (defstruct st a:(bitfield int32 18) b:(bitfield int32 14))
> 
> (st 0 1)
> 
> The 0 and 1 get the type (Integral 'a) => 'a by default, and they must 
> unify with the bitfield type in this case.

I understand the issue, but we are going to have to see what unexpected
problems this may create.

shap



More information about the bitc-dev mailing list