rfc:compact-object-property-assignment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:compact-object-property-assignment [2020/03/28 21:32] jgivonirfc:compact-object-property-assignment [2020/03/31 02:16] jgivoni
Line 18: Line 18:
 As an alternative to writing a data structure as an associative array, COPA gives the data a **//documented signature//** so that you know what parameters are expected and their value types. As an alternative to writing a data structure as an associative array, COPA gives the data a **//documented signature//** so that you know what parameters are expected and their value types.
  
-> COPA does not introduce any new concepts or complexities, but merely a new syntax aimed at making thousands of PHP developers write their code in a simpler way. The code becomes easier to write and read and thus more maintainable without any lateral limitations or factual downsides.+> COPA does not introduce any new concepts or complexities, but merely a new syntax aimed at making millions of PHP developers write their code in a simpler way. The code becomes easier to write and read and thus more maintainable without any lateral limitations or factual downsides.
  
 ==== Example ==== ==== Example ====
Line 422: Line 422:
 ); );
 </code> </code>
 +=== Syntax F ===
 +
 +**WITH** syntax
 +
 +<code php>
 +myObj.with {
 +     foo = 10
 +     bar = foo + 20
 +}
 +</code>
 +If this is the preferred syntax it will require a new RFC.
 +
 ===== Rejected Features ===== ===== Rejected Features =====
  
Line 452: Line 464:
 > **Note!** Chaining method calls is not an atomic operation either. The cost/benefit of implementing “transaction” and “rollback” behavior is negative. > **Note!** Chaining method calls is not an atomic operation either. The cost/benefit of implementing “transaction” and “rollback” behavior is negative.
  
-===== 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 for voting “No”. +<doodle title="Would you like to add support for COPA?" auth="jgivoni" voteType="single" closed="false"> 
- +   * Yes 
-The options will be: +   * No 
- +</doodle>
-  - I voted yes! +
-  - 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 negatively limit future changes +
-  - 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.+<doodle title="If you voted no, what was the main reason?" auth="jgivoni" voteType="single" closed="false"> 
 +   * I voted yes! 
 +   * 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 language evolution 
 +   * This will be a nightmare to implement and maintain 
 +   * I prefer not to say 
 +</doodle>
  
-There could be a 3rd vote on alternative syntaxes.+<doodle title="If you did not like the proposed syntax, which alternative would you prefer?" auth="jgivoni" voteType="single" closed="false"> 
 +   * A (the proposed one) 
 +   * B 
 +   * C 
 +   * D 
 +   * E 
 +   * F 
 +   * Irrelevant 
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
rfc/compact-object-property-assignment.txt · Last modified: 2020/04/14 06:30 by jgivoni