sonic-pi

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

C++

Code. Music. Live.

AST::Node#to_a

Returns {#children}. This is very useful in order to decompose nodes
concisely. For example:

    node = s(:gasgn, :$foo, s(:integer, 1))
    s
    var_name, value = *node
    p var_name # => :$foo
    p value    # => (integer 1)

Source | Google | Stack overflow

Edit

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

cd sonic-pi

open app/server/ruby/vendor/ast-2.0.0/lib/ast/node.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-AST--Node-to_a-for-pr


# Commit to git

git add app/server/ruby/vendor/ast-2.0.0/lib/ast/node.rbgit commit -m "better docs for AST::Node#to_a"


# Open pull request

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

hub fork

git push <your name> -your-name--update-docs-AST--Node-to_a-for-pr

hub pull-request


# Celebrate!