Skip to content

Quote operator #1474

@zimbatm

Description

@zimbatm

In cases where nix code is expressed but not to be evaluated, quoting (idea from lisp) could be useful. This would be a good way to embed code as metadata.

For example in NixOS/nixpkgs#27394 (comment) where code is used for the documentation, it could be described like this:

input = `id 123`;
output = `123`;

Where the backtick is the quoting mechanism.

It would mean that the editor could still do syntax highlighting, the parsing phase of the language could still validate the syntax, but the evaluation your be deferred.

What do you think @edolstra? Let me know if you want more examples or think it's worth a RFC.

Cheers.
z

Metadata

Metadata

Assignees

Labels

featureFeature request or proposallanguageThe Nix expression language; parser, interpreter, primops, evaluation, etc
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions