Skip to content

In-place assignment for awkward array? #609

Answered by jpivarski
Duchstf asked this question in Q&A
Discussion options

You must be logged in to vote

In-place assignment isn't supported as a design choice. There are two corners of "parameter space" we could have chosen:

  • allow in-place assignment and defensively copy arrays in complex operations, so that assignments don't lead to surprising long-distance consequences;
  • forbid in-place assignment and view, rather than copy, for most operations.

I chose the latter (after initial experience with an early version that did allow in-place assignment). Defensive copies would be prohibitive for large data structures, such as records with many fields (which are common). The choice to make everything immutable was made for performance (both speed and memory), which might sound surprising, consid…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Duchstf
Comment options

You must be logged in to vote
6 replies
@lukasheinrich
Comment options

@jpivarski
Comment options

@lukasheinrich
Comment options

@jpivarski
Comment options

@jpivarski
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants