Skip to content

Deprecate circshift() and make it lazy #25003

Open
@nalimilan

Description

This came up in a Slack discussion about adding lag and lead functions, which are similar to circshift. In many cases, allocating a vector to store the result of circshift is a waste, as a lazy view would be sufficient and as efficient. Looking at uses of circshift on GitHub shows several examples where the result is discarded immediately.

It would make sense to have Iterators.circshift, returning a custom AbstractArray object which would redirect getindex calls to the parent after shifting the index. circshift!(dest, src, shift) would be replaced with copy!(dest, Iterators.circshift(src, shift)).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    collectionsData structures holding multiple items, e.g. sets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions