From f8676149dd597306511b6545a872e20f5d5fdd6d Mon Sep 17 00:00:00 2001 From: ccjmne Date: Sun, 22 May 2022 18:24:28 +0200 Subject: [PATCH 1/2] Add missing `~` in syntax demonstration --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0076514..60d9277 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ allowing repeated references to the same argument value: ```js const add = (x, y) => x + y; -const dup = add(?0, ?0); +const dup = add~(?0, ?0); console.log(dup(3)); // prints: 6 ``` From 72fd469c28f60fa8a519384c3521e490ce803d43 Mon Sep 17 00:00:00 2001 From: Eric NICOLAS Date: Sun, 22 May 2022 18:21:55 +0200 Subject: [PATCH 2/2] Fix a few minor grammatical mistakes --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 60d9277..3163976 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ const addTen = x => add(x, 10); addTen(2); // 12 ``` -However, there are several of limitations with these approaches: +However, there are several limitations with these approaches: * `Function.prototype.bind` can only fix the leading arguments of a function. * `Function.prototype.bind` requires you explicitly specify the `this` receiver. @@ -180,7 +180,7 @@ printCxx(1, 2, 3); // prints: 3, arg1, arg2 ``` By having ordinal placeholder arguments independent of the ordering for non-ordinal placeholder arguments, we -avoid refactoring hazards due to the insertion a new ordinal placeholder into an existing partial application. +avoid refactoring hazards due to the insertion of a new ordinal placeholder into an existing partial application. _inserting an ordinal placeholder as the first argument:_ ```patch @@ -510,7 +510,7 @@ not actually difficult to read in most cases: `f~(?, a?.b ?? c)`. one or more parameter bindings in a resulting _partially applied function_. - _Non-Ordinal Placeholder Argument_ — A _placeholder argument_ representing a single unapplied argument. _Non-ordinal placeholder arguments_ are implicitly ordered sequentially from left to right. - A _non-ordinal placeholder argument_ is denoted by a `?` token that takes up an entire an argument position. + A _non-ordinal placeholder argument_ is denoted by a `?` token that takes up an entire argument position. Example: `f~(?)` - _Ordinal Placeholder Argument_ — A _placeholder argument_ representing a single unapplied argument with a specified ordinal position in the parameter list of the resulting _partially applied function_.