Hi
On 2/22/24 00:02, Matthew Weier O'Phinney wrote:
Once again in reading the proposal, the first thing I'm struck by are the
magic "$field" and "$value" variables inside accessors. The first time they
are used, they're used without explanation, and they're jarring.
[…]
Second: you don't have examples of defining BOTH get and set OTHER than
when using expressions for both accessors or a mix. I'm actually unclear
what the syntax is when both are defined. Is there supposed to be a `;`
terminating each? Or a `,`? Or just an empty line? Again, this is one of
the more common scenarios. It needs to be covered early, and clearly.
On a similar topic with regard to syntax and shorthands, I'd like to
quote myself from my previous year's email (Message-ID:
17d7983b-68b7-e273-a445-f8399c251...@bastelstu.be,
https://externals.io/message/120213#120216):
(5) I strongly dislike the doubly abbreviated form of public string $fullName =>
$this->first . " " . $this->last;. Having just the extra
'>' in there to distinguish it from a regular property feels non-obvious.
It's always possible to follow-up with syntax that allows for additional
brevity, the inverse is not true and I believe for such a semantically
complex feature, having clear and syntax syntax would be beneficial.
Best regards
Tim Düsterhus