# Ruby 1.8 insertion = new? ? ['new'] : [] list = ['hello','brave'] + insertion + ['world'] # Ruby 1.9 insertion = new? ? ['new'] : [] list = ['hello','brave',*insertion,'world'] # Arc now (let insertion (if (is-new) (list "new") nil) (join (list "hello" "brave") insertion (list "world"))) # With @ operation (let insertion (if (is-new) (list "new") nil) (list "hello" "brave" @insertion "world"))
(let insetion (if (is-new) (list "new") nil) `("hello" "brave" ,@insertion "world"))
-----