From: Jano Svitok Date: 2008-05-31T05:46:36+09:00 Subject: Re: PHP to Ruby (associative array to Hash) On Fri, May 30, 2008 at 6:50 PM, S.D wrote: > Great example! I don't quite understand the pointer(*) notation you are > using in ruby. How would "Hash[*TYPES.select" differ from > "Hash[TYPES.select"? > Is one a pointer to the Hash and the other the Hash itself? I thought Ruby > did not have pointers. * is not a pointer, it is so-called splat operator (google: ruby splat). It "expands" arrays. When you call f(*array) and array is [1,2,3] it has the same effect as calling f(1,2,3). Another useful pattern is: COLORS = ['red', 'green', 'blue'] DAYS = ['monday', sunday'] case word when *COLORS puts "#{word} is a Color!" when *DAYS puts "#{word} is a Day!" end For better explanation see google.