From fde43f53f8d0d198b5c98c255cb3c16282ac4a61 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Wed, 14 Oct 2026 20:32:23 +0000 Subject: [PATCH] PROPOSALS: a minus after an operator, keeping the leading one as it is A minus binding to its factor everywhere would change -a & b and -a shr n; only one after an operator is proposed. --- diff --git a/PROPOSALS.md b/PROPOSALS.md index 392aa43..afa89c3 100644 --- a/PROPOSALS.md +++ b/PROPOSALS.md @@ -63,11 +63,13 @@ but nearly every other language takes it, and the error ("expected an expression, found -") surprises. -The proposal: `"-" Factor` is a factor too. Where the two readings -both apply, as `-a * b`, they give the same value: an integer's -negation and product wrap alike, `-(a * b)` and `(-a) * b` are the -same bits, and so are they for reals. The smallest value of a signed -type is no exception: it is its own negation. +The proposal: a factor that follows an operator may be `"-" Factor`. +The minus at the start of a `SimpleExpr` stays as it is, applying to +the first term, so no program changes meaning: `-a & b` is still +`-(a & b)`, which isn't `(-a) & b`, nor is `-a shr n` the same as +`(-a) shr n`. Only text that is an error today, `x & -8`, gets one. +The cost is that a minus means two things by where it stands, which +the report would say in a line. Met in tery's `aligned`, `(a + 7) & -8`.