1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Add builtin function ‘fromJSON’

Fixes #294.
This commit is contained in:
Eelco Dolstra 2014-07-04 13:34:15 +02:00
parent e82951fe23
commit beaf3e90af
6 changed files with 217 additions and 0 deletions

View file

@ -257,6 +257,22 @@ stdenv.mkDerivation {
</varlistentry>
<varlistentry><term><function>builtins.fromJSON</function> <replaceable>e</replaceable></term>
<listitem><para>Convert a JSON string to a Nix
value. For example,
<programlisting>
builtins.fromJSON ''{"x": [1, 2, 3], "y": null}''
</programlisting>
returns the value <literal>{ x = [ 1 2 3 ]; y = null;
}</literal>. Floating point numbers are not
supported.</para></listitem>
</varlistentry>
<varlistentry><term><function>builtins.getAttr</function>
<replaceable>s</replaceable> <replaceable>set</replaceable></term>
@ -762,6 +778,7 @@ in foo</programlisting>
</varlistentry>
<varlistentry><term><function>builtins.toPath</function> <replaceable>s</replaceable></term>
<listitem><para>Convert the string value