Memory layout of a data structure: Difference between revisions

Content added Content deleted
m (→‎{{header|J}}: Add lang tags)
Line 234: Line 234:


J does not support "structures", nor "fields in a structure". Instead, J supports arrays. And, of course, J could have labels corresponding to the elements of an array representing the state (voltage, current, logical bit value, whatever) of each pin of a 9-pin RS-232 plug:
J does not support "structures", nor "fields in a structure". Instead, J supports arrays. And, of course, J could have labels corresponding to the elements of an array representing the state (voltage, current, logical bit value, whatever) of each pin of a 9-pin RS-232 plug:
<lang j>

labels=: <;._2]0 :0
labels=: <;._2]0 :0
CD Carrier detect
CD Carrier detect
Line 246: Line 246:
RI Ring indicator
RI Ring indicator
)
)
</lang>



=={{header|OCaml}}==
=={{header|OCaml}}==