Tue, 15 Mar 2005 13:01:22 -0800 (PST)
Thanks. I have followed your second suggestion more or less. I do everything
is Word8 and make sure I only use one bit.
--- Stephen Weeks <firstname.lastname@example.org> wrote:
> > I hope I am not missing something obvious but why is N > 1. Why not
> > Word1? Binary arithmetic is universally useful... just now I was trying to
> > write the code to compute a binary determinant of a binary matrix but alas
> > Word1 is not there. Maybe it was left out to keep it symmetric with the
> > case when Int1 would not make much sence. But word1 does...
> There is no good reason why Word1 isn't there. Until it is, if you're
> willing to live without source-level constants (0w0, 0w1), it is easy
> to implement yourself.
> structure Word1: WORD =
> datatype word = W0 | W1
> val op + =
> fn (W0, W0) => W0
> | (W0, W1) => W1
> | (W1, W0) => W1
> | (W1, W1) => W0
> Or, you could implement it much as we implement the other unusual word
> sizes, by embedding in a larger word size, Word8.word probably being
> the right choice.
> MLton mailing list
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.