NixOS / NixOS/nix.dev

Introduce the "if then else" concept

Open
#817 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

site
Dominant language
Nix
Stars
4k
Forks
339
Avg merge
2d 11h
Merged PRs (30d)
7

Description

Observations

The if ... then ... else ... concept is not introduced in the Nix language tutorial

Problem

This is a problem for discovering that the feature exists, or even to know what the exact syntax is. Some people not familiar with functional programming also might not know the "if then else" statement must "return" a value.

Approaches

Introduce a section, maybe just before the "Functions" section. Maybe mention that there is no "for/while loop" constructs.

Willing to help?

With a little help, sure!

Priorities

Add 👍 to issues you find important.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open source/tutorials/nix-language.md and review the material around the Functions section; use the issue's suggested placement as the starting point. Add an introductory section covering if ... then ... else ... syntax, its value-returning behavior, and the absence of for/while loops; done when the tutorial addresses these points.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.