Open staycoolcall911 opened 1 year ago
Hi,
This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!
Since we replace readwrite
with let var
, do we want to revise this section of the spec? I think we can also just remove this from the spec for now.
@MarkMcCulloh, @yoav-steinberg, @Chriscbr, @hasanaburayyan, @eladb, @ekeren, @ShaiBer - WDYT?
Yes please!
@staycoolcall911 No hard objections from me on removing computed properties to simplify the spec (unless there's another reason?), but just want to say that I think the var
modifier and computed properties solve different problems, so I don't think we should confuse them by accident.
I completely agree with your last remark @Chriscbr; I was referring to the fact that initially we made computed properties syntax read
, write
to resemble our former spec for reassignability readwrite
. Since we recently removed readwrite
, it makes sense to revisit read
and write
(and I suggest to simplify our spec by removing them altogether, even though they are a completely different feature from readwrite
).
Assign this to me. I'll take a look at the spec and make sure it's more consistent with var
.
I still think we need computed properties, but that's also something we can put as P2
The following section should be added to the language reference:
3.9 Computed Properties
You may use the following syntax to define computed properties.
Computed properties are syntactic sugar for getters and setters which themselves are syntactic sugar for methods, therefore omitting either one is acceptable.
"Read block" must always return a value of the same type as the property. Keyword
new
can be used inside the write block to access the incoming r-value of the assignment (write) operation.new
is always the same type as the type of the property itself.Both preflight and inflight computed properties are allowed.
Keyword
var
behind computed properties is not allowed.inflight
computed properties are also allowed.