Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Created April 29, 2015 00:26
Show Gist options
  • Select an option

  • Save StoneCypher/771db2784858c30dc2fd to your computer and use it in GitHub Desktop.

Select an option

Save StoneCypher/771db2784858c30dc2fd to your computer and use it in GitHub Desktop.
-module(record_joy).
-export([
datum/0,
fetch/0
]).
-record(outer, { contained }).
-record(inner, { value }).
datum() ->
I = #inner{ value=5 },
O = #outer{ contained=I },
O.
fetch() ->
D = datum(),
(D#outer.contained)#inner.value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment