Skip to content

Instantly share code, notes, and snippets.

@pkulev
Created October 17, 2014 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkulev/30cbc9899b5cc8165b89 to your computer and use it in GitHub Desktop.
Save pkulev/30cbc9899b5cc8165b89 to your computer and use it in GitHub Desktop.
local FillRecord in
fun {FillRecord Features Values Rec}
case Features
of H|T then
case Values.1
of Lab|Feat|Val then
{FillRecord T Values.2
{AdjoinAt Rec H
{Transform Lab|Feat|Val}}}
[] Val then
{FillRecord T Values.2 {AdjoinAt Rec H Val}}
end
[] nil then Rec
end
end
{FillRecord L.2.1 L.2.2.1 {Record.make L.1 nil}}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment