sonic-pi

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

C++

Code. Music. Live.

AST::Node#updated

Returns a new instance of Node where non-nil arguments replace the
corresponding fields of `self`.

For example, `Node.new(:foo, [ 1, 2 ]).updated(:bar)` would yield
`(bar 1 2)`, and `Node.new(:foo, [ 1, 2 ]).updated(nil, [])` would
yield `(foo)`.

If the resulting node would be identical to `self`, does nothing.

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-updated-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#updated"


# 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-updated-for-pr

hub pull-request


# Celebrate!