Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
[bug] Array#first(symbol) doesn't raise?
Simon Strandgaard
10/24/2004 1:19:00 PM
irb(main):001:0> %w(a b c).first(:xyz)
=> ["a", "b", "c"]
irb(main):002:0> %w(a b c).last(:xyz)
=> ["a", "b", "c"]
This seems inconsistent to me. I would expect a TypeError.
--
Simon Strandgaard
2 Answers
ts
10/24/2004 1:25:00 PM
0
>>>>> "S" == Simon Strandgaard <neoneye@adslhome.dk> writes:
S> irb(main):001:0> %w(a b c).first(:xyz)
svg% ruby -we '%w(a b c).first(:xyz)'
-e:1: warning: treating Symbol as an integer
svg%
Guy Decoux
Simon Strandgaard
10/24/2004 1:36:00 PM
0
On Sunday 24 October 2004 15:25, ts wrote:
> ruby -we '%w(a b c).first(:xyz)'
Ah.. I see. You have good insight. Thanks.
--
Simon Strandgaard
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[bug] Array#first(symbol) doesn't raise?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password