JuliaArrays / JuliaArrays/StaticArrays.jl

Constructing StaticArrays with generators or ntuple-like syntax

Open
#97 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

design feature up for grabs
Dominant language
Julia
Stars
844
Forks
159
Avg merge
3d 21h
Merged PRs (30d)
3

Description

The following presumably creates a temporary:

julia> SVector(ntuple(i->i^2, 3))
3-element StaticArrays.SVector{3,Int64}:
 1
 4
 9

It would be great to be able to do

julia> SVector(i->i^2, 3)
3-element StaticArrays.SVector{3,Int64}:
 1
 4
 9

without creating the tuple temporary.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files or tests are named. Start by locating the SVector constructor entry points and existing constructor tests, then compare the current ntuple form with the requested generator-like form. Done means SVector(i->i^2, 3) produces the shown values without requiring the caller to create a tuple temporary.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.