Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
:s.respond_to?(:dup) && :s.dup raises
Francois Beausoleil
4/5/2007 5:41:00 PM
Hi all !Symbol lies about it's ability to respond_to? to #dup:irb(main):001:0> :s.respond_to?(:dup)=> trueirb(main):002:0> :s.dupTypeError: can't dup Symbol from (irb):2:in `dup' from (irb):2Fixnum does the same thing. You might argue that the object *can*respond to :dup, except it's simply illegal to respond to it.Anyway, my feeling is that Symbol and Fixnum (probably Numeric) shouldnot respond_to?(:dup).Thanks !-- François Beausoleil
http://blog.teksol.info/http://piston.ruby...
1 Answer
Tim Hunter
4/5/2007 5:56:00 PM
0
François Beausoleil wrote:
> Anyway, my feeling is that Symbol and Fixnum (probably Numeric) should
> not respond_to?(:dup).
Here's a 76-post thread on this very subject, from about six, seven
weeks ago.
http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/239426?239...
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
:s.respond_to?(:dup) && :s.dup raises
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