Nix bitwise operators? (nix-devel thread)

Posted on nix-devel:

builtins for modulo + power could also emulated binary operator.

Another vote for “don’t add special operators for this”. These kind of operations are, realistically, an edge case - and operators are extremely expensive to add to a language; there’s a limited space of symbols that can be used for operators, and operators are practically impossible to ever deprecate.

Built-in functions could indeed be a solution here, and a bitfield type may also be interesting if it can be sufficiently motivated to have common usecases.

1 Like