Skip to content

Instantly share code, notes, and snippets.

@ruslander
Last active December 21, 2015 13:19
Show Gist options
  • Save ruslander/6312029 to your computer and use it in GitHub Desktop.
Save ruslander/6312029 to your computer and use it in GitHub Desktop.
play with records
% definition
1>rd(om, {nume, gen, virsta}).
om
% new instance
2> I = #om{nume=ru, gen=f, virsta=12}.
#om{nume = ru,gen = f,virsta = 12}
% new from template
3> P = I#om{nume=go}.
#om{nume = go,gen = f,virsta = 12}
% read property
4> G = I#om.gen.
f
% match and extract
5> #om{nume=N} = I.
#om{nume = ru,gen = f,virsta = 12}
6> N.
ru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment