in reply to Re^2: What's wrong with Perl 6?
in thread What's wrong with Perl 6?
## ## Sigil invariance ## array = [1, 3, 5, 12, 37, 42] # I use symbols here, but one can use strings: {'alpha' => 4, 'beta' = +> 6} # hash = {:alpha => 4, :beta => 6} third = array[2] # This would be hash['beta'] when using strings # beta = hash[:beta] # Ruby doesn't slice as a part of syntax - there are special member # methods for that. I personally see it as a good thing. odds = array.values_at(1, 3, 5) bets = hash.values_at(:alpha, :beta)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: What's wrong with Perl 6?
by chromatic (Archbishop) on May 11, 2007 at 17:48 UTC | |
by jdporter (Paladin) on May 14, 2007 at 14:24 UTC | |
by chromatic (Archbishop) on May 14, 2007 at 15:16 UTC | |
by kyle (Abbot) on May 14, 2007 at 15:29 UTC |