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 frozenarray type to builtins #860

Closed
mark-koch opened this issue Mar 13, 2025 · 0 comments · Fixed by #868
Closed

Add frozenarray type to builtins #860

mark-koch opened this issue Mar 13, 2025 · 0 comments · Fixed by #868
Assignees
Labels

Comments

@mark-koch
Copy link
Collaborator

Methods:

  • __len__(self: frozenarray[n, L]) implemented with Guppy source
  • __getitem__(self: frozenarray[n, L], idx: int) -> L lowers to Hugr op (maybe custom compiler to convert index to usize)
  • __iter__(self: frozenarray[n, L] @owned) -> FrozenarrayIter[n, L] implemented with Guppy source

Also use frozenarray instead of array when loading lists from py expressions

github-merge-queue bot pushed a commit that referenced this issue Mar 25, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Closes #860

BREAKING CHANGE: Lists loaded from `py(...)` expressions are now turned
into immutable `frozenarray`s instead of regular `array`s.

---------

Co-authored-by: Douglas Wilson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant