From 87bf541f23723f6a8c7f05c89984c5df0c450ec2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Apr 2004 15:51:26 +0000 Subject: * Documented the primops. --- doc/manual/nix-lang-ref.xml | 100 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 3 deletions(-) (limited to 'doc/manual/nix-lang-ref.xml') diff --git a/doc/manual/nix-lang-ref.xml b/doc/manual/nix-lang-ref.xml index 19917144e..5d53063ce 100644 --- a/doc/manual/nix-lang-ref.xml +++ b/doc/manual/nix-lang-ref.xml @@ -4,9 +4,6 @@ Grammar - - - Expressions @@ -97,6 +94,8 @@ | | + 'true' | 'false' | 'null' + | '(' ')' | '{' * '}' @@ -180,4 +179,99 @@ + + + + Semantics + + + + + Built-in functions + + + The Nix language provides the following built-in function + (primops): + + + + + + import + e + + + Evaluates the expression e, + which must yield a path value. The Nix expression + stored at this path in the file system is then read, + parsed, and evaluated. Returns the result of the + evaluation of the Nix expression just read. + + + + Example: import ./foo.nix evaluates + the expression stored in foo.nix + (in the directory containing the expression in which the + import occurs). + + + + + + derivation + e + + + Evaluates the expression e, + which must yield an attribute set. [...] + + + + + + baseNameOf + e + + + Evaluates the expression e, + which must yield a string value, and returns a string + representing its base name. This + is the substring following the last path separator + (/). + + + + Example: baseNameOf "/foo/bar" + returns "bar", and + baseNameOf "/foo/bar/" returns + "". + + + + + + toString + e + + + Evaluates the expression e + and coerces it into a string, if possible. Only + strings, paths, and URIs can be so coerced. + + + + Example: toString + http://www.cs.uu.nl/ returns + "http://www.cs.uu.nl/". + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3