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

Add computed fields to the composite value #664

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

SupunS
Copy link
Member

@SupunS SupunS commented Mar 5, 2021

Closes #660

Working towards #650

Description

A computed field is a func(*Interpreter) Value function pointer. Invoking this function computes the value on the fly and returns it.

A computed value takes an *Interpreter as an argument, as computation of the value may rely on the interpreter.
e.g: auth account fields


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -5341,6 +5342,8 @@ type CompositeValue struct {
modified bool
}

type ComputedField func(*Interpreter) Value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to introduce a type for this 👍

@SupunS SupunS merged commit be1b0ca into master Mar 5, 2021
@SupunS SupunS deleted the supun/refactor-native-types-1 branch March 19, 2021 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for computed fields in CompositeValue
2 participants