From: Bomshik Kim <bskim@ropas.kaist.ac.kr>
To: caml-list@inria.fr
Subject: How can I treat bits?
Date: Thu, 31 Aug 2000 22:13:14 +0900 (KST) [thread overview]
Message-ID: <Pine.GSO.4.10.10008312210560.10363-100000@ropas.kaist.ac.kr> (raw)
In C language, we can define a variable size as a unit of bits.
For example, "unsigned int a:1 ;", " unsigned int b:4 ;" ....
"colon" is used to set up the number of bits.
Can I define OCaml-variables in the same way?
Because I want to make some data header by using bits as little as
possible.
the style that I imagine is...
type hd = { flag : int_1 ; on_off : int_1 ; seq_num : int_4 } ;;
let header = { flag = 1 ; on_off = 0 ; seq_num = 0101 } ;;
Thank you.
-BS Kim
next reply other threads:[~2000-08-31 18:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-31 13:13 Bomshik Kim [this message]
2000-09-01 8:20 ` Xavier Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.10.10008312210560.10363-100000@ropas.kaist.ac.kr \
--to=bskim@ropas.kaist.ac.kr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox