Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* How can I treat bits?
@ 2000-08-31 13:13 Bomshik Kim
  2000-09-01  8:20 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Bomshik Kim @ 2000-08-31 13:13 UTC (permalink / raw)
  To: caml-list



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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-09-01  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-31 13:13 How can I treat bits? Bomshik Kim
2000-09-01  8:20 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox