You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of writing, object property access is performed via array subscript operator and string subscripts like so obj['foo']. This is not the ideal long-term solution and causes some confusion about the semantics of objects in Walt.
The long-term solution is to provide a new dot . binary operator which would be a single way to access properties on an object type.
Acceptance Criteria
The dot . operator which is not currently supported. We would need the tokenizer to recognize it (easy) and for the parser to convert it down to a plain old array subscript.
Unit tests
Removing/converting string property lookups, in examples and tests.
Identifiers as object definitions should work
The text was updated successfully, but these errors were encountered:
No, not really, I do have plans for at least static strings, so I would like to keep string tokenizing around.
We should have one way of dealing with objects/structs. However, I don't think it needs to be all bundled under one PR either. It's totally fine to do this piece by piece, property lookups followed by object definitions, followed by a final cleanup of string property lookups.
Goal
Improve consistency, make Walt object types appear more like structs(which they are).
Overview
Original issue (#22)
As of writing, object property access is performed via array subscript operator and string subscripts like so
obj['foo']
. This is not the ideal long-term solution and causes some confusion about the semantics of objects in Walt.The long-term solution is to provide a new dot
.
binary operator which would be a single way to access properties on an object type.Acceptance Criteria
The text was updated successfully, but these errors were encountered: