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

DOPE-239: implemented all objectFunctions with extensions for cm and added tests #64

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

Conversation

jansigi
Copy link
Collaborator

@jansigi jansigi commented Nov 12, 2024

No description provided.

@jansigi jansigi self-assigned this Nov 12, 2024
Copy link
Collaborator

@martinagallati-ergon martinagallati-ergon left a comment

Choose a reason for hiding this comment

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

Did you purposefully leave out the OBJECT_FIELD function because of the ObjectEntry?

Base automatically changed from feature/dope-216-objects to main November 19, 2024 09:18
@jansigi jansigi force-pushed the feature/dope-239-object-funcitons branch from 2da79e1 to c5b7e69 Compare November 21, 2024 08:44
Comment on lines +12 to +13
newAttributeKey: TypeExpression<StringType>,
newAttributeValue: TypeExpression<out ValidType>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be a ObjectEntryPrimitive?

objectExpression: TypeExpression<ObjectType>,
) : FunctionExpression<NumberType>("OBJECT_LENGTH", objectExpression)

fun TypeExpression<ObjectType>.length() = ObjectLengthExpression(this)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you should be consistent with arrays. Using arrays we don't use extension-functions and name it arrayLength. It's confusing for the user if we change the syntax always

Copy link
Collaborator

Choose a reason for hiding this comment

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

(Comment is for all the object-functions)


class ObjectRenameExpression(
objectExpression: TypeExpression<ObjectType>,
oldField: TypeExpression<StringType>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would go for oldFieldName and newFieldName


class ObjectValuesExpression(
objectExpression: TypeExpression<ObjectType>,
) : FunctionExpression<ArrayType<StringType>>("OBJECT_VALUES", objectExpression)
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's not correct right? I guess it returns an array of ValidType

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