From 477c71d89d107936cd0c4776bb2d5ff37cb91539 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Wed, 13 Nov 2024 20:53:05 -0800 Subject: Allow oper-assign, += -= etc --- chapter17/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'chapter17/README.md') diff --git a/chapter17/README.md b/chapter17/README.md index 1bac940b..d65ff879 100644 --- a/chapter17/README.md +++ b/chapter17/README.md @@ -12,6 +12,14 @@ Also allows `s.fld++` and `ary[idx]++`, and their `--` variants. Allow pre-increment for identifiers only, for now: `--pc`. +## Operator assignment + +Along the same lines as post-increment, we now allow `op=` assignment +with semantics similar to other languages. + +`x += y` + + ## var & val `var` can be used in the `type` position to indicate a "variable" (mutable @@ -125,11 +133,5 @@ return i; // ERROR: Undefined name 'i' -oper-assign +=, -= TODO switch - - - - - -- cgit v1.2.3