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

Support more forms of assignment in constant expressions #105

Merged
merged 1 commit into from
Sep 24, 2020

Conversation

udoprog
Copy link
Collaborator

@udoprog udoprog commented Sep 24, 2020

This adds support for targeting in constant expression, i.e. the following kind of expressions:

let object = #{};
object.test = #{};
object.test.test = 42;

However, these currently do not have the same semantics as regular Rune execution. Non-primitive rhs values are cloned, rather than refcounted. To change this, we need to introduce the use of a Value-like structure in the IrInterpreter which then converts the computed result into ConstValue once it has been evaluated.

@udoprog udoprog force-pushed the const-object-tuple-like-assign branch from 586b50a to 11cf257 Compare September 24, 2020 16:47
@udoprog udoprog added the enhancement New feature or request label Sep 24, 2020
@udoprog udoprog merged commit 3f469f1 into master Sep 24, 2020
@udoprog udoprog deleted the const-object-tuple-like-assign branch September 24, 2020 18:23
@udoprog udoprog added the changelog Issue has been added to the changelog label Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue has been added to the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant