Giter Club home page Giter Club logo

Comments (4)

edolstra avatar edolstra commented on August 15, 2024

As a slight aside, we should consider getting rid of nested records because they make things unnecessarily complicated. For example, with Nixpkgs overlays, it's easy to override a top-level package foo, but good luck figuring out how to override perlPackages.foo.

So the record { a = 1; b.c = 2; } shouldn't be a record containing fields a and b (where b is a record containing c), but a record containing fields a and b.c. This removes ambiguity about what self refers to, e.g. in { a = 1; b.a = 2; b.c = self.a; }, b.c would evaluate to 1, since self refers to the entire record.

Edit: this is more relevant to #84, since it means a.b.c = {e="bar"}; is something different than a.b.c.e = "bar";.

from nickel.

edolstra avatar edolstra commented on August 15, 2024

I think my preference would be for something that behaves like the NixOS module system, but without any special syntax like rec or config.<attr> or self. So you could write { a = 1; b = a; }, and the value of b depends on whether this record is later extended with a definition that overrides a.

from nickel.

mboes avatar mboes commented on August 15, 2024

Is this closed by #135? Sounds like the decision was made there to not require an explicit rec keyword. The rest of this issue appears to be obsolete.

from nickel.

yannham avatar yannham commented on August 15, 2024

Closed by #135 for records, superseded by #525 for let-binding.

from nickel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.