sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Hamster::List#transpose

Gather the first element of each nested list into a new `List`, then the second
element of each nested list, then the third, and so on. In other words, if each
nested list is a "row", return a `List` of "columns" instead.

Although the returned list is lazy, each returned nested list (each "column")
is strict. So while each nested list in the input can be infinite, the parent
`List` must not be, or trying to realize the first element in the output will
cause an infinite loop.

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/hamster-3.0.0/lib/hamster/list.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Hamster--List-transpose-for-pr


# Commit to git

git add app/server/ruby/vendor/hamster-3.0.0/lib/hamster/list.rbgit commit -m "better docs for Hamster::List#transpose"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Hamster--List-transpose-for-pr

hub pull-request


# Celebrate!