From: John Pritchard-williams Date: 2008-08-29T20:39:38+09:00 Subject: Parameter Type Checking in methods.Q? Again...just wondering....(and you can probably tell I'm comparing Ruby with Java/C here again, following on from the "++" discussion...) def MyObject def my_method(obj) if obj.class!=String then raise "Wrong Type!" end ...stuff... end end Would it cause problems with the general syntax to include some sugar to rewrite this as: ... def my_method(String obj) end ... Or is there any quick easy meta-programming to label methods as expecting certain types? Or am I being a big-baby wanting this kind of check, and I should get on with the Dynamic Vibe of Ruby ? :) (I just noticed that sometimes I get lost in my own programs by not checking types thoroughly; yet Java would have forced me to stop and think...) John -- Posted via http://www.ruby-forum.com/.