rfc:compact-object-property-assignment
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:compact-object-property-assignment [2020/03/28 21:32] – jgivoni | rfc:compact-object-property-assignment [2020/04/14 06:30] (current) – jgivoni | ||
---|---|---|---|
Line 6: | Line 6: | ||
* Date: 2020-03-17 | * Date: 2020-03-17 | ||
* Author: Jakob Givoni < | * Author: Jakob Givoni < | ||
- | * Status: | + | * Status: |
+ | * Discussion: | ||
===== Introduction ===== | ===== Introduction ===== | ||
Line 18: | Line 19: | ||
As an alternative to writing a data structure as an associative array, COPA gives the data a **// | As an alternative to writing a data structure as an associative array, COPA gives the data a **// | ||
- | > COPA does not introduce any new concepts or complexities, | + | > COPA does not introduce any new concepts or complexities, |
==== Example ==== | ==== Example ==== | ||
Line 153: | Line 154: | ||
<code php> | <code php> | ||
(new Foo)->[ | (new Foo)->[ | ||
- | om => ' | + | om = ' |
mane = ' | mane = ' | ||
hum = (new Foo)->[ | hum = (new Foo)->[ | ||
Line 422: | Line 423: | ||
); | ); | ||
</ | </ | ||
+ | === Syntax F === | ||
+ | |||
+ | **WITH** syntax | ||
+ | |||
+ | <code php> | ||
+ | myObj.with { | ||
+ | foo = 10 | ||
+ | bar = foo + 20 | ||
+ | } | ||
+ | </ | ||
+ | If this is the preferred syntax it will require a new RFC. | ||
+ | |||
===== Rejected Features ===== | ===== Rejected Features ===== | ||
Line 452: | Line 465: | ||
> **Note!** Chaining method calls is not an atomic operation either. The cost/ | > **Note!** Chaining method calls is not an atomic operation either. The cost/ | ||
- | ===== Proposed Voting Choices | + | ===== Vote ===== |
+ | |||
+ | Voting starts 2020-03-31 and ends 2020-04-13. | ||
The primary vote of whether or not to accept this RFC requires a 2/3 majority. | The primary vote of whether or not to accept this RFC requires a 2/3 majority. | ||
- | A secondary “vote” directed at no-voters, will ask you the primary reason | + | <doodle title=" |
+ | * Yes | ||
+ | | ||
+ | </ | ||
- | The options will be: | + | \\ |
- | | + | <doodle title=" |
- | | + | |
- | | + | * I don’t find the feature useful |
- | | + | * I don’t like the syntax |
- | | + | * I prefer a more comprehensive solution to this problem |
- | | + | * I prefer a narrower solution to this problem |
- | | + | * This breaks backwards compatibility |
- | | + | * This will have negative implications for future |
- | | + | * This will be a nightmare to implement and maintain |
+ | * I prefer not to say | ||
+ | </ | ||
- | This will help understand what the obstacles are, when studying this RFC in the future, should anyone be tempted to have another shot at object literals et. al. | + | \\ |
- | There could be a 3rd vote on alternative | + | <doodle title=" |
+ | * A (the proposed one) | ||
+ | * B | ||
+ | * C | ||
+ | * D | ||
+ | * E | ||
+ | * F | ||
+ | * Irrelevant | ||
+ | </ | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== |
rfc/compact-object-property-assignment.1585431148.txt.gz · Last modified: 2020/03/28 21:32 by jgivoni