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

Pancake shape improvement #1035

Open
JunmingZhao42 opened this issue Aug 6, 2024 · 1 comment
Open

Pancake shape improvement #1035

JunmingZhao42 opened this issue Aug 6, 2024 · 1 comment

Comments

@JunmingZhao42
Copy link

It seems that currently we can read from shape by index, but cannot write to shape by index. For example

fun main () {
    var hello = lds {3} @base;
    // hello.0 = 0; --> this doesn't work
    stw @base, 0;
    return 0;
}

Would be nice to write to shape by index as well (if can we can index by namestrings that'd be even better!)

@myreen
Copy link
Contributor

myreen commented Aug 6, 2024

Adding support for such assignments makes a lot of sense. I guess there should be support for nesting, ie

a.0.2.0 = ...

This should be a language construct in the Pancake AST and semantics rather than just syntactic sugar. Or rather: the construct for assignment should be revised so that this is possible.

Regarding names for fields (and shapes), yes, definitely that should be supported. The intention was never that these index numbers would be written (regularly) by humans. However, the string names should be a separate issue.

@mktnk3 mktnk3 added the Pancake label Aug 9, 2024
@mn200 mn200 added this to the Pancake Syntactic Sugar milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants