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 the 'fields' primitive. #142

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Add the 'fields' primitive. #142

merged 1 commit into from
Jun 8, 2020

Conversation

ltratt
Copy link
Member

@ltratt ltratt commented Jun 8, 2020

This returns a class's fields. However, SOM's semantics on this are currently unclear (see SOM-st/SOM#40). Although we allow users to mutate the 'methods' array, this is less sensible with fields in my opinion, since it would turn SOM from a statically into a dynamically scoped language. Thus, each time you call 'fields' you get a fresh array back such that any mutations made are ignored (see the mutate_fields test).

This returns a class's fields. However, SOM's semantics on this are currently
unclear (see SOM-st/SOM#40). Although we allow users
to mutate the 'methods' array, this is less sensible with fields in my opinion,
since it would turn SOM from a statically into a dynamically scoped language.
Thus, each time you call 'fields' you get a fresh array back such that any
mutations made are ignored (see the `mutate_fields` test).
@ptersilie
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 8, 2020

Build succeeded:

@bors bors bot merged commit 07bdc9f into softdevteam:master Jun 8, 2020
@ltratt ltratt deleted the fields branch June 9, 2020 06:43
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.

2 participants