Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce RecordOf to get record type from a table type #2739

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

adithyaselv
Copy link
Contributor

@adithyaselv adithyaselv commented Nov 12, 2024

Introduce RecordOf syntax to get record type from a table type.

eg:

Account := Type(RecordOf(Accounts));

Points := Type([{x : Number, y : Number}]); 
Point := Type(RecordOf(Points));
 distance(a: Point, b: Point): Number = Sqrt(Power(b.x-a.x, 2) + Power(b.y-a.y, 2));

RecordOf works only within a TypeLiteral . Lays foundations for future type helpers (eg: Union multiple record types ... ) that we may have.

  • This ensures that we can avoid reserving RecordOf keyword in functions
  • Avoids ambiguity when we move Named formula syntax to use := for example ,
Account := RecordOf(Accounts);

can mean type vs an UDF

@LucGenetier
Copy link
Contributor

✅ No public API change.

@adithyaselv adithyaselv changed the title [Draft] Introduce RecordOf syntax to get record type from a table type Introduce RecordOf syntax to get record type from a table type Nov 15, 2024
@adithyaselv adithyaselv marked this pull request as ready for review November 15, 2024 00:00
@adithyaselv adithyaselv requested a review from a team as a code owner November 15, 2024 00:00
@LucGenetier
Copy link
Contributor

✅ No public API change.

@adithyaselv adithyaselv changed the title Introduce RecordOf syntax to get record type from a table type Introduce RecordOf to get record type from a table type Nov 15, 2024
@LucGenetier
Copy link
Contributor

✅ No public API change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants