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 list primitive type to clox #7

Closed
zxul767 opened this issue Nov 5, 2022 · 2 comments
Closed

add list primitive type to clox #7

zxul767 opened this issue Nov 5, 2022 · 2 comments
Labels
enhancement New feature or request p0

Comments

@zxul767
Copy link
Owner

zxul767 commented Nov 5, 2022

jlox already implements the list primitive type (although it doesn't have literal syntax yet). clox should implement it too to have feature parity.

For its expected usage and API, look at samples/list.lox. The only additional piece of syntax needed is for indexing, which takes the form list[index]. In the jlox implementation we experimented with desugaring to a method call to __setitem__ and it worked quite well. We should document this in the (not yet written) spec for Lox.

@zxul767 zxul767 changed the title add list primitive type to clox add list primitive type to clox Nov 5, 2022
@zxul767 zxul767 changed the title add list primitive type to clox add list primitive type to clox Nov 9, 2022
@zxul767 zxul767 added the enhancement New feature or request label Nov 11, 2022
@zxul767 zxul767 added the p0 label Dec 7, 2022
@zxul767
Copy link
Owner Author

zxul767 commented Dec 7, 2022

marking as p0 simply because there's already WIP to implement this and we don't want to stall that.

@zxul767
Copy link
Owner Author

zxul767 commented Dec 9, 2022

this is now in main

@zxul767 zxul767 closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p0
Projects
None yet
Development

No branches or pull requests

1 participant