Hi

On 5/9/24 15:10, Andreas Hennings wrote:
The syntax is well suited for the most common case, which is regular
wither methods for one or more known properties.
I don't like the array syntax as a default. It has inferior DX for
regular withers, and possible performance impact from the temporary
array.

Again [1]: The choice of syntax cannot influence runtime performance after the code is compiled, because it is just that - syntax.

It would be perfectly possible to specifically handle the case where the 'with' is followed by an array literal and then not construct a temporary array. In fact this is how the current implementation works: It doesn't actually support arrays yet, it just borrows the syntax of an array, because it more naturally extends to supporting arrays in the future.

Best regards
Tim Düsterhus

[1] See also my previous email: https://externals.io/message/120048#120073

Reply via email to