Ticket #121 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

dynamic object types

Reported by: cormac Assigned to: anonymous
Type: defect Priority: major
Milestone: M2 Component: Proposals
Version: 4 Keywords:
Cc:

Description (last modified by cormac) (diff)

In the type language, we may want to express to distinct kinds of types:

- a structural object type with a p:int field, and possibly other fields, which the type system allows access to (really, a dynamic object type)

- a structural object type with a p:int field, and no other fields that the type system allows access to (a non-dynamic object type)

If we wish to support both, then the syntax {p:int,*} and {p:int} seems to work well. A next question is which is Object like?

A related issue is:

-- Object or {} denotes the empty object, which is distinct from the dynamic object {*}. However, Array or [] denotes the dynamically-typed array, which is equivalent to [*]. Although not a bug per se, there is a certain lack of symmetry here.

Attachments

Change History

Changed 1 year ago by cormac

  • description changed from In the type language, we may want to express to distinct kinds of types: - a structural object type with a ''p:int'' field, and possibly other fields, which the type system allows access to (really, a dynamic object type) - a structural object type with a ''p:int'' field, and no other fields that the type system allows access to (a non-dynamic object type) If we wish to support both, then the syntax ''{p:int,*}'' and ''{p:int}'' seems to work well. A next question is which is ''Object'' like? to In the type language, we may want to express to distinct kinds of types: - a structural object type with a ''p:int'' field, and possibly other fields, which the type system allows access to (really, a dynamic object type) - a structural object type with a ''p:int'' field, and no other fields that the type system allows access to (a non-dynamic object type) If we wish to support both, then the syntax ''{p:int,*}'' and ''{p:int}'' seems to work well. A next question is which is ''Object'' like? A related issue is: -- Object or {} denotes the empty object, which is distinct from the dynamic object {*}. However, Array or [] denotes the dynamically-typed array, which is equivalent to [*]. Although not a bug per se, there is a certain lack of symmetry here.

Changed 1 year ago by cormac

  • status changed from new to closed
  • resolution set to fixed

Made redundant by moving to option 9.

Note: See TracTickets for help on using tickets.