The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Ruby's Array>>shift is shifty

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bob Hutchison

Posts: 165
Nickname: bobhutch
Registered: Aug, 2005

Bob Hutchison has been developing software for a long time, currently at Recursive Design Inc.
Ruby's Array>>shift is shifty Posted: Sep 23, 2006 4:36 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Bob Hutchison.
Original Post: Ruby's Array>>shift is shifty
Feed Title: This used to be fun! ... What happened? | Ruby
Feed URL: https://bobhutchison.wordpress.com/feed/
Feed Description: The Ruby side of my efforts to put the fun back into programming.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Bob Hutchison
Latest Posts From This used to be fun! ... What happened? | Ruby

Advertisement
Here is a simple Ruby expression: (a = [1, 2, 3]).shift The value of a will be [2, 3] which is exactly what you'd expect. The thing is, there is a bug here. The Pick Axe book describes the shift function as: Returns the first element of arr and removes it (shifting all other ...

Read: Ruby's Array>>shift is shifty

Topic: YDN Ruby Previous Topic   Next Topic Topic: What's New in Edge Rails: Get Your RSS & Atom Feeds for Free

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use