mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
* Evaluate lets directly (i.e. without desugaring to `rec { attrs...;
<let-body> = e; }.<let-body>). This prevents the unnecessary allocation of an attribute set.
This commit is contained in:
parent
ac1e8f40d4
commit
7d47498b5e
5 changed files with 45 additions and 1 deletions
|
@ -87,6 +87,16 @@ void ExprLambda::show(std::ostream & str)
|
|||
str << ": " << *body << ")";
|
||||
}
|
||||
|
||||
void ExprLet::show(std::ostream & str)
|
||||
{
|
||||
str << "let ";
|
||||
foreach (list<Symbol>::iterator, i, attrs->inherited)
|
||||
str << "inherit " << *i << "; ";
|
||||
foreach (ExprAttrs::Attrs::iterator, i, attrs->attrs)
|
||||
str << i->first << " = " << *i->second << "; ";
|
||||
str << "in " << *body;
|
||||
}
|
||||
|
||||
void ExprWith::show(std::ostream & str)
|
||||
{
|
||||
str << "with " << *attrs << "; " << *body;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue