Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

when constructing a record type with MAYBE attributes, if those attributes are unmentioned in the construction, default them to NOTHING #645

@mengwong

Description

@mengwong

this saves us saying a load of someAttribute IS NOTHING

Example

DECLARE Person HAS
  Name IS A STRING
  BirthDate IS A MAYBE Date
  Nationality IS A MAYBE Country

Previous to this patch, we would have had to say:

`John Doe` MEANS Person WITH
  Name IS "John Doe"
  BirthDate IS NOTHING
  Nationality IS NOTHING

After this patch, we can say:

`John Doe` MEANS Person WITH
  Name IS "John Doe"

And the MAYBE attributes get auto-set to NOTHING.

Note that this only works for the WITH / IS form of instantiation – the OF syntax doesn't benefit from this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions