Skip to content
Snippets Groups Projects
  1. Mar 05, 2012
  2. Oct 24, 2010
  3. Oct 22, 2010
  4. Jun 10, 2010
  5. May 07, 2010
  6. Apr 15, 2010
  7. Apr 13, 2010
  8. Apr 12, 2010
  9. Apr 07, 2010
  10. Mar 31, 2010
    • Ludovic Courtès's avatar
      Make source location info in the XML output optional. · 09381ccc
      Ludovic Courtès authored
      * src/libexpr/expr-to-xml.cc (nix::showAttrs): Add `location'
        parameter.  Provide location XML attributes when it's true.  Update
        callers.
        (nix::printTermAsXML): Likewise.
      
      * src/libexpr/expr-to-xml.hh (nix::printTermAsXML): Update prototype;
        have `location' default to `false'.
      
      * src/nix-instantiate/nix-instantiate.cc (printResult, processExpr): Add
        `location' parameter; update callers.
        (run): Add support for `--no-location'.
      
      * src/nix-instantiate/help.txt: Update accordingly.
      
      * tests/lang.sh: Invoke `nix-instantiate' with `--no-location' for the
        XML tests.
      
      * tests/lang/eval-okay-toxml.exp, tests/lang/eval-okay-to-xml.nix: New
        files.
      09381ccc
    • Ludovic Courtès's avatar
      Add source location information to the XML output. · 471419d1
      Ludovic Courtès authored
      * src/libexpr/expr-to-xml.cc (nix::showAttrs): Dereference the attribute
        RHS.  Add "path", "line", and "column" XML attributes to the node when
        source location information is available.
        (nix::printTermAsXML): Likewise for functions.
      471419d1
  11. Mar 25, 2010
  12. Aug 14, 2008
    • Eelco Dolstra's avatar
      * Added an experimental feature suggested by Andres: ellipses ("...") · 9279174d
      Eelco Dolstra authored
        in attribute set pattern matches.  This allows defining a function
        that takes *at least* the listed attributes, while ignoring
        additional attributes.  For instance,
      
          {stdenv, fetchurl, fuse, ...}:
          
          stdenv.mkDerivation {
            ...
          };
          
        defines a function that requires an attribute set that contains the 
        specified attributes but ignores others.  The main advantage is that
        we can then write in all-packages.nix
      
          aefs = import ../bla/aefs pkgs;
      
        instead of
      
          aefs = import ../bla/aefs {
            inherit stdenv fetchurl fuse;
          };
      
        This saves a lot of typing (not to mention not having to update
        all-packages.nix with purely mechanical changes).  It saves as much
        typing as the "args: with args;" style, but has the advantage that
        the function arguments are properly declared (not implicit in what
        the body of the "with" uses).
      9279174d
    • Eelco Dolstra's avatar
      * @-patterns as in Haskell. For instance, in a function definition · 1b962fc7
      Eelco Dolstra authored
          f = args @ {x, y, z}: ...;
      
        `args' refers to the argument as a whole, which is further
        pattern-matched against the attribute set pattern {x, y, z}.
      1b962fc7
    • Eelco Dolstra's avatar
      * Refactoring: combine functions that take an attribute set and · efe4b690
      Eelco Dolstra authored
        functions that take a single argument (plain lambdas) into one AST
        node (Function) that contains a Pattern node describing the
        arguments.  Current patterns are single lazy arguments (VarPat) and
        matching against an attribute set (AttrsPat).
      
        This refactoring allows other kinds of patterns to be added easily,
        such as Haskell-style @-patterns, or list pattern matching.
      efe4b690
  13. Aug 11, 2008
  14. May 21, 2008
  15. Jan 13, 2007
  16. Oct 16, 2006
    • Eelco Dolstra's avatar
      * Big cleanup of the semantics of paths, strings, contexts, string · d7efd763
      Eelco Dolstra authored
        concatenation and string coercion.  This was a big mess (see
        e.g. NIX-67).  Contexts are now folded into strings, so that they
        don't cause evaluation errors when they're not expected.  The
        semantics of paths has been clarified (see nixexpr-ast.def).
        toString() and coerceToString() have been merged.
      
        Semantic change: paths are now copied to the store when they're in a
        concatenation (and in most other situations - that's the
        formalisation of the meaning of a path).  So
      
          "foo " + ./bla
      
        evaluates to "foo /nix/store/hash...-bla", not "foo
        /path/to/current-dir/bla".  This prevents accidental impurities, and
        is more consistent with the treatment of derivation outputs, e.g.,
        `"foo " + bla' where `bla' is a derivation.  (Here `bla' would be
        replaced by the output path of `bla'.)
      d7efd763
  17. Oct 11, 2006
  18. Oct 03, 2006
  19. Sep 04, 2006
  20. Aug 24, 2006
Loading