From 87bf541f23723f6a8c7f05c89984c5df0c450ec2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Apr 2004 15:51:26 +0000 Subject: [PATCH] * Documented the primops. --- doc/manual/nix-lang-ref.xml | 100 ++++++++++++++++++++++++++++++++++-- doc/manual/style.css | 5 ++ 2 files changed, 102 insertions(+), 3 deletions(-) diff --git a/doc/manual/nix-lang-ref.xml b/doc/manual/nix-lang-ref.xml index 19917144e7..5d53063ce7 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 diff --git a/doc/manual/style.css b/doc/manual/style.css index 5b8534533d..a9b6fd2c67 100644 --- a/doc/manual/style.css +++ b/doc/manual/style.css @@ -218,4 +218,9 @@ div.epigraph { font-style: italic; text-align: right; +} + +table.productionset table.productionset +{ + font-family: monospace; } \ No newline at end of file