Memory layout of a data structure: Difference between revisions

Content added Content deleted
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>
<lang j>labels=: <;._2]0 :0
labels=: <;._2]0 :0
CD Carrier detect
CD Carrier detect
RD Received data
RD Received data
Line 245: Line 244:
CTS Clear to send
CTS Clear to send
RI Ring indicator
RI Ring indicator
)</lang>
)
</lang>


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